; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/Other/DIBZ2016/DZ16SHOP/A.ll (Z5solvev)

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

@cost = external dso_local global [310 x [310 x i64]], align 16
@X = external dso_local global [310 x i32], align 16
@Y = external dso_local global [310 x i32], align 16
@P = external dso_local global [310 x i32], align 16
@A = external dso_local global [10100 x i32], align 16
@countingSort = external dso_local global [1010 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 [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z12reinitializei(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 uwtable
declare dso_local noundef i64 @_Z24minCostBipartiteMatchingv() #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %34, %0
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %37

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [310 x i32], ptr @Y, i64 0, i64 %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [310 x i32], ptr @P, i64 0, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %26, ptr noundef %29, ptr noundef %32)
  br label %34

34:                                               ; preds = %23
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %3, align 4, !tbaa !5
  br label %18, !llvm.loop !9

37:                                               ; preds = %22
  call void @llvm.memset.p0.i64(ptr align 16 @countingSort, i8 0, i64 4040, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 1000000001, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1000000001, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %66, %37
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %45
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %46)
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1010 x i32], ptr @countingSort, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !5
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %57
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %5, align 4, !tbaa !5
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %62
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %63)
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %6, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %43
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %7, align 4, !tbaa !5
  br label %38, !llvm.loop !13

69:                                               ; preds = %42
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %72 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %72, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %109, %69
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = icmp sge i32 %74, %75
  br i1 %76, label %77, label %81

77:                                               ; preds = %73
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = icmp sle i32 %78, %79
  br label %81

81:                                               ; preds = %77, %73
  %82 = phi i1 [ false, %73 ], [ %80, %77 ]
  br i1 %82, label %84, label %83

83:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %112

84:                                               ; preds = %81
  br label %85

85:                                               ; preds = %97, %84
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = icmp sle i32 %86, %87
  br i1 %88, label %89, label %95

89:                                               ; preds = %85
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1010 x i32], ptr @countingSort, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br label %95

95:                                               ; preds = %89, %85
  %96 = phi i1 [ false, %85 ], [ %94, %89 ]
  br i1 %96, label %97, label %108

97:                                               ; preds = %95
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %99 to i64
  %102 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %101
  store i32 %98, ptr %102, align 4, !tbaa !5
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1010 x i32], ptr @countingSort, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %105, align 4, !tbaa !5
  br label %85, !llvm.loop !14

108:                                              ; preds = %95
  br label %109

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

112:                                              ; preds = %83
  %113 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z12reinitializei(i32 noundef %113)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %245, %112
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = load i32, ptr %1, align 4, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 13, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %248

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

120:                                              ; preds = %218, %119
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = icmp sle i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 16, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %221

125:                                              ; preds = %120
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [310 x i32], ptr @Y, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %129, %133
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = icmp sle i32 %134, %138
  br i1 %139, label %140, label %176

140:                                              ; preds = %125
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [310 x i32], ptr @Y, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = mul nsw i64 1, %145
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [310 x i32], ptr @P, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = mul nsw i64 %146, %151
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = sub nsw i32 %156, %160
  %162 = load i32, ptr %10, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [310 x i32], ptr @Y, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sub nsw i32 %161, %165
  %167 = sext i32 %166 to i64
  %168 = mul nsw i64 %167, 1000000001
  %169 = add nsw i64 %152, %168
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [310 x [310 x i64]], ptr @cost, i64 0, i64 %171
  %173 = load i32, ptr %12, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [310 x i64], ptr %172, i64 0, i64 %174
  store i64 %169, ptr %175, align 8, !tbaa !11
  br label %217

176:                                              ; preds = %125
  %177 = load i32, ptr %10, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %12, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = icmp sle i32 %180, %184
  br i1 %185, label %186, label %209

186:                                              ; preds = %176
  %187 = load i32, ptr %12, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = load i32, ptr %10, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = sub nsw i32 %190, %194
  %196 = sext i32 %195 to i64
  %197 = load i32, ptr %10, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [310 x i32], ptr @P, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = mul nsw i64 %196, %201
  %203 = load i32, ptr %10, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [310 x [310 x i64]], ptr @cost, i64 0, i64 %204
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [310 x i64], ptr %205, i64 0, i64 %207
  store i64 %202, ptr %208, align 8, !tbaa !11
  br label %216

209:                                              ; preds = %176
  %210 = load i32, ptr %10, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [310 x [310 x i64]], ptr @cost, i64 0, i64 %211
  %213 = load i32, ptr %12, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [310 x i64], ptr %212, i64 0, i64 %214
  store i64 0, ptr %215, align 8, !tbaa !11
  br label %216

216:                                              ; preds = %209, %186
  br label %217

217:                                              ; preds = %216, %140
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %12, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %12, align 4, !tbaa !5
  br label %120, !llvm.loop !16

221:                                              ; preds = %124
  %222 = load i32, ptr %2, align 4, !tbaa !5
  %223 = load i32, ptr %1, align 4, !tbaa !5
  %224 = icmp slt i32 %222, %223
  br i1 %224, label %225, label %244

225:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %226 = load i32, ptr %2, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %13, align 4, !tbaa !5
  br label %228

228:                                              ; preds = %240, %225
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = load i32, ptr %1, align 4, !tbaa !5
  %231 = icmp sle i32 %229, %230
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  store i32 19, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %243

233:                                              ; preds = %228
  %234 = load i32, ptr %10, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [310 x [310 x i64]], ptr @cost, i64 0, i64 %235
  %237 = load i32, ptr %13, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [310 x i64], ptr %236, i64 0, i64 %238
  store i64 0, ptr %239, align 8, !tbaa !11
  br label %240

240:                                              ; preds = %233
  %241 = load i32, ptr %13, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %13, align 4, !tbaa !5
  br label %228, !llvm.loop !17

243:                                              ; preds = %232
  br label %244

244:                                              ; preds = %243, %221
  br label %245

245:                                              ; preds = %244
  %246 = load i32, ptr %10, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %10, align 4, !tbaa !5
  br label %114, !llvm.loop !18

248:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %261, %248
  %250 = load i32, ptr %15, align 4, !tbaa !5
  %251 = load i32, ptr %2, align 4, !tbaa !5
  %252 = icmp sle i32 %250, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %249
  store i32 22, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %264

254:                                              ; preds = %249
  %255 = load i32, ptr %15, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  %259 = load i32, ptr %14, align 4, !tbaa !5
  %260 = add nsw i32 %259, %258
  store i32 %260, ptr %14, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %254
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %15, align 4, !tbaa !5
  br label %249, !llvm.loop !19

264:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %265 = call noundef i64 @_Z24minCostBipartiteMatchingv()
  store i64 %265, ptr %16, align 8, !tbaa !11
  %266 = load i32, ptr %14, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = load i64, ptr %16, align 8, !tbaa !11
  %269 = sdiv i64 %268, 1000000001
  %270 = sub nsw i64 %267, %269
  %271 = trunc i64 %270 to i32
  %272 = load i64, ptr %16, align 8, !tbaa !11
  %273 = srem i64 %272, 1000000001
  %274 = trunc i64 %273 to i32
  %275 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %271, i32 noundef %274)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

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

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

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

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

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

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

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

@cost = external dso_local local_unnamed_addr global [310 x [310 x i64]], align 16
@X = external dso_local global [310 x i32], align 16
@Y = external dso_local global [310 x i32], align 16
@P = external dso_local global [310 x i32], align 16
@A = external dso_local global [10100 x i32], align 16
@countingSort = external dso_local local_unnamed_addr global [1010 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 [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z12reinitializei(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 uwtable
declare dso_local noundef i64 @_Z24minCostBipartiteMatchingv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %.not76 = icmp slt i32 %6, 1
  br i1 %.not76, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) @countingSort, i8 0, i64 4040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 1000000001, ptr %4, align 4, !tbaa !5
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %.not6578 = icmp slt i32 %7, 1
  br i1 %.not6578, label %._crit_edge82, label %.lr.ph81

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %8 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %indvars.iv
  %9 = getelementptr inbounds [310 x i32], ptr @Y, i64 0, i64 %indvars.iv
  %10 = getelementptr inbounds [310 x i32], ptr @P, i64 0, i64 %indvars.iv
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not.not = icmp slt i64 %indvars.iv, %13
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge82:                                    ; preds = %.lr.ph81, %._crit_edge
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %15 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %15, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = icmp sge i32 %16, %17
  %19 = icmp sgt i32 %15, 0
  %20 = select i1 %18, i1 %19, i1 false
  br i1 %20, label %.preheader75.preheader, label %._crit_edge86

.preheader75.preheader:                           ; preds = %._crit_edge82
  %21 = zext nneg i32 %15 to i64
  %22 = sext i32 %16 to i64
  %23 = sext i32 %17 to i64
  br label %.preheader75

.lr.ph81:                                         ; preds = %._crit_edge, %.lr.ph81
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %.lr.ph81 ], [ 1, %._crit_edge ]
  %24 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %indvars.iv102
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %24)
  %26 = load i32, ptr %24, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1010 x i32], ptr @countingSort, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  store i32 %32, ptr %3, align 4, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %4, align 4, !tbaa !5
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %.not65.not = icmp slt i64 %indvars.iv102, %36
  br i1 %.not65.not, label %.lr.ph81, label %._crit_edge82, !llvm.loop !11

.preheader75:                                     ; preds = %.preheader75.preheader, %.critedge
  %indvars.iv108 = phi i64 [ %22, %.preheader75.preheader ], [ %indvars.iv.next109, %.critedge ]
  %.05885 = phi i32 [ 1, %.preheader75.preheader ], [ %.1.lcssa, %.critedge ]
  %37 = getelementptr inbounds [1010 x i32], ptr @countingSort, i64 0, i64 %indvars.iv108
  %.promoted = load i32, ptr %37, align 4, !tbaa !5
  %38 = sext i32 %.05885 to i64
  %39 = add i32 %.05885, %.promoted
  %smin = call i32 @llvm.smin.i32(i32 %.promoted, i32 0)
  %40 = sub i32 %39, %smin
  %wide.trip.count = sext i32 %40 to i64
  %41 = trunc nsw i64 %indvars.iv108 to i32
  %smax = call i64 @llvm.smax.i64(i64 %38, i64 %21)
  %42 = sub i64 %smax, %38
  %43 = freeze i64 %42
  %44 = sub nsw i64 %wide.trip.count, %38
  %umin = call i64 @llvm.umin.i64(i64 %43, i64 %44)
  %45 = add nsw i64 %umin, 1
  %min.iters.check = icmp ult i64 %45, 9
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader75
  %indvars.iv105.ph = phi i64 [ %38, %.preheader75 ], [ %ind.end, %middle.block ]
  %.ph = phi i32 [ %.promoted, %.preheader75 ], [ %54, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader75
  %n.mod.vf = and i64 %45, 7
  %46 = icmp eq i64 %n.mod.vf, 0
  %47 = select i1 %46, i64 8, i64 %n.mod.vf
  %n.vec = sub i64 %45, %47
  %ind.end = add i64 %n.vec, %38
  %48 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.promoted, i64 0
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %41, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %48, %vector.ph ], [ %51, %vector.body ]
  %vec.phi146 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %52, %vector.body ]
  %offset.idx = add i64 %index, %38
  %49 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %offset.idx
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  store <4 x i32> %broadcast.splat, ptr %49, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %50, align 4, !tbaa !5
  %51 = add <4 x i32> %vec.phi, <i32 -1, i32 -1, i32 -1, i32 -1>
  %52 = add <4 x i32> %vec.phi146, <i32 -1, i32 -1, i32 -1, i32 -1>
  %index.next = add nuw i64 %index, 8
  %53 = icmp eq i64 %index.next, %n.vec
  br i1 %53, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %52, %51
  %54 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  store i32 %54, ptr %37, align 4, !tbaa !5
  br label %scalar.ph.preheader

._crit_edge86:                                    ; preds = %.critedge, %._crit_edge82
  %55 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z12reinitializei(i32 noundef %55)
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %.not6692 = icmp slt i32 %56, 1
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br i1 %.not6692, label %.preheader, label %.preheader74.lr.ph

.preheader74.lr.ph:                               ; preds = %._crit_edge86
  %.not6887 = icmp slt i32 %.pre, 1
  %57 = icmp slt i32 %.pre, %56
  br i1 %.not6887, label %.preheader74.lr.ph.split.us, label %.preheader74.preheader

.preheader74.preheader:                           ; preds = %.preheader74.lr.ph
  %58 = add nuw i32 %.pre, 1
  %59 = zext nneg i32 %.pre to i64
  %60 = shl nuw nsw i64 %59, 3
  %61 = xor i32 %.pre, -1
  %62 = add nsw i32 %56, %61
  %63 = zext i32 %62 to i64
  %64 = shl nuw nsw i64 %63, 3
  %65 = add nuw nsw i64 %64, 8
  %wide.trip.count126 = zext nneg i32 %56 to i64
  %66 = getelementptr i8, ptr @cost, i64 %60
  %67 = getelementptr i8, ptr %66, i64 2488
  %wide.trip.count116 = zext i32 %58 to i64
  br label %.preheader74

.preheader74.lr.ph.split.us:                      ; preds = %.preheader74.lr.ph
  br i1 %57, label %.preheader74.us.us.preheader, label %.preheader

.preheader74.us.us.preheader:                     ; preds = %.preheader74.lr.ph.split.us
  %68 = sext i32 %.pre to i64
  %69 = shl nsw i64 %68, 3
  %70 = xor i32 %.pre, -1
  %71 = add i32 %56, %70
  %72 = zext i32 %71 to i64
  %73 = shl nuw nsw i64 %72, 3
  %74 = add nuw nsw i64 %73, 8
  %wide.trip.count135 = zext nneg i32 %56 to i64
  %75 = getelementptr i8, ptr @cost, i64 %69
  %76 = getelementptr i8, ptr %75, i64 2488
  %xtraiter = and i64 %wide.trip.count135, 7
  %77 = icmp ult i32 %56, 8
  br i1 %77, label %.preheader.loopexit.unr-lcssa, label %.preheader74.us.us.preheader.new

.preheader74.us.us.preheader.new:                 ; preds = %.preheader74.us.us.preheader
  %unroll_iter = and i64 %wide.trip.count135, 2147483640
  %invariant.gep = getelementptr i8, ptr %76, i64 2480
  %invariant.gep174 = getelementptr i8, ptr %76, i64 4960
  %invariant.gep176 = getelementptr i8, ptr %76, i64 7440
  %invariant.gep178 = getelementptr i8, ptr %76, i64 9920
  %invariant.gep180 = getelementptr i8, ptr %76, i64 12400
  %invariant.gep182 = getelementptr i8, ptr %76, i64 14880
  %invariant.gep184 = getelementptr i8, ptr %76, i64 17360
  br label %.preheader74.us.us

.preheader74.us.us:                               ; preds = %.preheader74.us.us, %.preheader74.us.us.preheader.new
  %indvar128 = phi i64 [ 0, %.preheader74.us.us.preheader.new ], [ %indvar.next129.7, %.preheader74.us.us ]
  %niter = phi i64 [ 0, %.preheader74.us.us.preheader.new ], [ %niter.next.7, %.preheader74.us.us ]
  %78 = mul nuw nsw i64 %indvar128, 2480
  %scevgep130 = getelementptr i8, ptr %76, i64 %78
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep130, i8 0, i64 %74, i1 false), !tbaa !15
  %79 = mul nuw i64 %indvar128, 2480
  %gep = getelementptr i8, ptr %invariant.gep, i64 %79
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep, i8 0, i64 %74, i1 false), !tbaa !15
  %80 = mul nuw i64 %indvar128, 2480
  %gep175 = getelementptr i8, ptr %invariant.gep174, i64 %80
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep175, i8 0, i64 %74, i1 false), !tbaa !15
  %81 = mul nuw i64 %indvar128, 2480
  %gep177 = getelementptr i8, ptr %invariant.gep176, i64 %81
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep177, i8 0, i64 %74, i1 false), !tbaa !15
  %82 = mul nuw i64 %indvar128, 2480
  %gep179 = getelementptr i8, ptr %invariant.gep178, i64 %82
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep179, i8 0, i64 %74, i1 false), !tbaa !15
  %83 = mul nuw i64 %indvar128, 2480
  %gep181 = getelementptr i8, ptr %invariant.gep180, i64 %83
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep181, i8 0, i64 %74, i1 false), !tbaa !15
  %84 = mul nuw i64 %indvar128, 2480
  %gep183 = getelementptr i8, ptr %invariant.gep182, i64 %84
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep183, i8 0, i64 %74, i1 false), !tbaa !15
  %85 = mul nuw i64 %indvar128, 2480
  %gep185 = getelementptr i8, ptr %invariant.gep184, i64 %85
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep185, i8 0, i64 %74, i1 false), !tbaa !15
  %indvar.next129.7 = add nuw nsw i64 %indvar128, 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 %.preheader.loopexit.unr-lcssa, label %.preheader74.us.us, !llvm.loop !17

scalar.ph:                                        ; preds = %scalar.ph.preheader, %87
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %87 ], [ %indvars.iv105.ph, %scalar.ph.preheader ]
  %86 = phi i32 [ %89, %87 ], [ %.ph, %scalar.ph.preheader ]
  %exitcond.not = icmp eq i64 %indvars.iv105, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %87

87:                                               ; preds = %scalar.ph
  %indvars.iv.next106 = add nsw i64 %indvars.iv105, 1
  %88 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %indvars.iv105
  store i32 %41, ptr %88, align 4, !tbaa !5
  %89 = add nsw i32 %86, -1
  store i32 %89, ptr %37, align 4, !tbaa !5
  %.not72.not = icmp slt i64 %indvars.iv105, %21
  br i1 %.not72.not, label %scalar.ph, label %.critedge, !llvm.loop !18

.critedge:                                        ; preds = %scalar.ph, %87
  %.1.lcssa.in = phi i64 [ %indvars.iv105, %scalar.ph ], [ %indvars.iv.next106, %87 ]
  %.1.lcssa = trunc i64 %.1.lcssa.in to i32
  %indvars.iv.next109 = add nsw i64 %indvars.iv108, -1
  %90 = icmp sgt i64 %indvars.iv108, %23
  %91 = icmp sge i32 %15, %.1.lcssa
  %92 = select i1 %90, i1 %91, i1 false
  br i1 %92, label %.preheader75, label %._crit_edge86, !llvm.loop !19

.preheader74:                                     ; preds = %.preheader74.preheader, %.loopexit
  %indvars.iv122 = phi i64 [ 1, %.preheader74.preheader ], [ %indvars.iv.next123, %.loopexit ]
  %indvar = phi i64 [ 0, %.preheader74.preheader ], [ %indvar.next, %.loopexit ]
  %93 = mul nuw nsw i64 %indvar, 2480
  %scevgep = getelementptr i8, ptr %67, i64 %93
  %94 = getelementptr inbounds [310 x i32], ptr @X, i64 0, i64 %indvars.iv122
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = getelementptr inbounds [310 x i32], ptr @Y, i64 0, i64 %indvars.iv122
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %97, %95
  %99 = sext i32 %97 to i64
  %100 = getelementptr inbounds [310 x i32], ptr @P, i64 0, i64 %indvars.iv122
  br label %110

.preheader.loopexit.unr-lcssa:                    ; preds = %.preheader74.us.us, %.preheader74.us.us.preheader
  %indvar128.unr = phi i64 [ 0, %.preheader74.us.us.preheader ], [ %indvar.next129.7, %.preheader74.us.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.preheader74.us.us.epil

.preheader74.us.us.epil:                          ; preds = %.preheader.loopexit.unr-lcssa, %.preheader74.us.us.epil
  %indvar128.epil = phi i64 [ %indvar.next129.epil, %.preheader74.us.us.epil ], [ %indvar128.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader74.us.us.epil ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %101 = mul nuw nsw i64 %indvar128.epil, 2480
  %scevgep130.epil = getelementptr i8, ptr %76, i64 %101
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep130.epil, i8 0, i64 %74, i1 false), !tbaa !15
  %indvar.next129.epil = add nuw nsw i64 %indvar128.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 %.preheader, label %.preheader74.us.us.epil, !llvm.loop !20

.preheader:                                       ; preds = %.loopexit, %.preheader.loopexit.unr-lcssa, %.preheader74.us.us.epil, %.preheader74.lr.ph.split.us, %._crit_edge86
  %.not6794 = icmp slt i32 %.pre, 1
  br i1 %.not6794, label %._crit_edge98, label %.lr.ph97.preheader

.lr.ph97.preheader:                               ; preds = %.preheader
  %102 = add nuw i32 %.pre, 1
  %wide.trip.count141 = zext i32 %102 to i64
  %103 = zext nneg i32 %.pre to i64
  %min.iters.check149 = icmp ult i32 %.pre, 8
  br i1 %min.iters.check149, label %.lr.ph97.preheader164, label %vector.ph150

.lr.ph97.preheader164:                            ; preds = %middle.block147, %.lr.ph97.preheader
  %indvars.iv137.ph = phi i64 [ 1, %.lr.ph97.preheader ], [ %ind.end153, %middle.block147 ]
  %.05495.ph = phi i32 [ 0, %.lr.ph97.preheader ], [ %109, %middle.block147 ]
  br label %.lr.ph97

vector.ph150:                                     ; preds = %.lr.ph97.preheader
  %n.vec152 = and i64 %103, 2147483640
  %ind.end153 = or disjoint i64 %n.vec152, 1
  br label %vector.body155

vector.body155:                                   ; preds = %vector.body155, %vector.ph150
  %index156 = phi i64 [ 0, %vector.ph150 ], [ %index.next161, %vector.body155 ]
  %vec.phi157 = phi <4 x i32> [ zeroinitializer, %vector.ph150 ], [ %106, %vector.body155 ]
  %vec.phi158 = phi <4 x i32> [ zeroinitializer, %vector.ph150 ], [ %107, %vector.body155 ]
  %offset.idx159 = or disjoint i64 %index156, 1
  %104 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %offset.idx159
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %wide.load = load <4 x i32>, ptr %104, align 4, !tbaa !5
  %wide.load160 = load <4 x i32>, ptr %105, align 4, !tbaa !5
  %106 = add <4 x i32> %wide.load, %vec.phi157
  %107 = add <4 x i32> %wide.load160, %vec.phi158
  %index.next161 = add nuw i64 %index156, 8
  %108 = icmp eq i64 %index.next161, %n.vec152
  br i1 %108, label %middle.block147, label %vector.body155, !llvm.loop !22

middle.block147:                                  ; preds = %vector.body155
  %bin.rdx162 = add <4 x i32> %107, %106
  %109 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx162)
  %cmp.n = icmp eq i64 %n.vec152, %103
  br i1 %cmp.n, label %._crit_edge98, label %.lr.ph97.preheader164

._crit_edge90:                                    ; preds = %128
  br i1 %57, label %.preheader73, label %.loopexit

.preheader73:                                     ; preds = %._crit_edge90
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %65, i1 false), !tbaa !15
  br label %.loopexit

110:                                              ; preds = %.preheader74, %128
  %indvars.iv112 = phi i64 [ 1, %.preheader74 ], [ %indvars.iv.next113, %128 ]
  %111 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %indvars.iv112
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %.not70 = icmp sgt i32 %98, %112
  br i1 %.not70, label %121, label %113

113:                                              ; preds = %110
  %114 = load i32, ptr %100, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = mul nsw i64 %115, %99
  %117 = sub i32 %112, %98
  %118 = sext i32 %117 to i64
  %119 = mul nsw i64 %118, 1000000001
  %120 = add nsw i64 %116, %119
  br label %128

121:                                              ; preds = %110
  %.not71 = icmp sgt i32 %95, %112
  br i1 %.not71, label %128, label %122

122:                                              ; preds = %121
  %123 = sub nsw i32 %112, %95
  %124 = sext i32 %123 to i64
  %125 = load i32, ptr %100, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = mul nsw i64 %126, %124
  br label %128

128:                                              ; preds = %121, %113, %122
  %.sink = phi i64 [ %120, %113 ], [ %127, %122 ], [ 0, %121 ]
  %129 = getelementptr inbounds [310 x [310 x i64]], ptr @cost, i64 0, i64 %indvars.iv122, i64 %indvars.iv112
  store i64 %.sink, ptr %129, align 8, !tbaa !15
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond117.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count116
  br i1 %exitcond117.not, label %._crit_edge90, label %110, !llvm.loop !23

.loopexit:                                        ; preds = %.preheader73, %._crit_edge90
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond127.not = icmp eq i64 %indvar.next, %wide.trip.count126
  br i1 %exitcond127.not, label %.preheader, label %.preheader74, !llvm.loop !17

._crit_edge98:                                    ; preds = %.lr.ph97, %middle.block147, %.preheader
  %.054.lcssa = phi i32 [ 0, %.preheader ], [ %109, %middle.block147 ], [ %138, %.lr.ph97 ]
  %130 = call noundef i64 @_Z24minCostBipartiteMatchingv()
  %.neg = sdiv i64 %130, -1000000001
  %131 = trunc i64 %.neg to i32
  %132 = add i32 %.054.lcssa, %131
  %133 = srem i64 %130, 1000000001
  %134 = trunc nsw i64 %133 to i32
  %135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %132, i32 noundef %134)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret void

.lr.ph97:                                         ; preds = %.lr.ph97.preheader164, %.lr.ph97
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %.lr.ph97 ], [ %indvars.iv137.ph, %.lr.ph97.preheader164 ]
  %.05495 = phi i32 [ %138, %.lr.ph97 ], [ %.05495.ph, %.lr.ph97.preheader164 ]
  %136 = getelementptr inbounds [10100 x i32], ptr @A, i64 0, i64 %indvars.iv137
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %137, %.05495
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %exitcond142.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count141
  br i1 %exitcond142.not, label %._crit_edge98, label %.lr.ph97, !llvm.loop !24
}

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #6

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

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

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

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


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