; LLVM IR from tangjz/acm-icpc :: 51nod (1392)

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

%struct.Box = type { i32, i32 }

@a = external dso_local global [210 x %struct.Box], align 16
@n = external dso_local global i32, align 4
@g = external dso_local global [210 x [210 x i32]], align 16
@lx = external dso_local global [210 x i32], align 16
@ly = external dso_local global [210 x i32], align 16
@match = external dso_local global [210 x i32], align 16
@ans = external dso_local global i32, align 4
@sx = external dso_local global [210 x i8], align 16
@sy = external dso_local global [210 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z4pathi(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
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

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

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %31

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %20
  %22 = getelementptr inbounds %struct.Box, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.Box, ptr %25, i32 0, i32 1
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %22, ptr noundef %26)
  br label %28

28:                                               ; preds = %18
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

31:                                               ; preds = %17
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct.Box, ptr @a, i64 %33
  call void @_ZSt4sortIP3BoxEvT_S2_(ptr noundef @a, ptr noundef %34)
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %struct.Box, ptr @a, i64 %36
  %38 = call noundef ptr @_ZSt6uniqueIP3BoxET_S2_S2_(ptr noundef @a, ptr noundef %37)
  %39 = ptrtoint ptr %38 to i64
  %40 = sub i64 %39, ptrtoint (ptr @a to i64)
  %41 = sdiv exact i64 %40, 8
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %130, %31
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %133

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %50
  %52 = getelementptr inbounds %struct.Box, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !11
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %55
  %57 = getelementptr inbounds %struct.Box, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !13
  %59 = mul nsw i32 %53, %58
  %60 = load i32, ptr @ans, align 4, !tbaa !5
  %61 = add nsw i32 %60, %59
  store i32 %61, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %5, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %112, %48
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %64
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %71
  %73 = getelementptr inbounds %struct.Box, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !11
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.Box, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !11
  %80 = icmp sle i32 %74, %79
  br i1 %80, label %81, label %111

81:                                               ; preds = %69
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.Box, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !13
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.Box, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !13
  %92 = icmp sle i32 %86, %91
  br i1 %92, label %93, label %111

93:                                               ; preds = %81
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %95
  %97 = getelementptr inbounds %struct.Box, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !11
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.Box, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !13
  %104 = mul nsw i32 %98, %103
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %106
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [210 x i32], ptr %107, i64 0, i64 %109
  store i32 %104, ptr %110, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %93, %81, %69
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %5, align 4, !tbaa !5
  br label %64, !llvm.loop !14

115:                                              ; preds = %68
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Box, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 8, !tbaa !11
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.Box, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !13
  %126 = mul nsw i32 %120, %125
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %115
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %3, align 4, !tbaa !5
  br label %43, !llvm.loop !15

133:                                              ; preds = %47
  call void @llvm.memset.p0.i64(ptr align 16 @match, i8 -1, i64 840, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %254, %133
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %257

139:                                              ; preds = %134
  br label %140

140:                                              ; preds = %252, %139
  br label %141

141:                                              ; preds = %140
  call void @llvm.memset.p0.i64(ptr align 16 @sx, i8 0, i64 210, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @sy, i8 0, i64 210, i1 false)
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = call noundef zeroext i1 @_Z4pathi(i32 noundef %142)
  br i1 %143, label %144, label %145

144:                                              ; preds = %141
  br label %253

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1061109567, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %213, %145
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = load i32, ptr @n, align 4, !tbaa !5
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %216

151:                                              ; preds = %146
  %152 = load i32, ptr %8, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [210 x i8], ptr @sx, i64 0, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !16, !range !18, !noundef !19
  %156 = trunc i8 %155 to i1
  br i1 %156, label %158, label %157

157:                                              ; preds = %151
  br label %213

158:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %209, %158
  %160 = load i32, ptr %9, align 4, !tbaa !5
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %212

164:                                              ; preds = %159
  %165 = load i32, ptr %9, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [210 x i8], ptr @sy, i64 0, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !16, !range !18, !noundef !19
  %169 = trunc i8 %168 to i1
  br i1 %169, label %208, label %170

170:                                              ; preds = %164
  %171 = load i32, ptr %7, align 4, !tbaa !5
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = load i32, ptr %9, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = add nsw i32 %175, %179
  %181 = load i32, ptr %8, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %182
  %184 = load i32, ptr %9, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [210 x i32], ptr %183, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = sub nsw i32 %180, %187
  %189 = icmp sgt i32 %171, %188
  br i1 %189, label %190, label %208

190:                                              ; preds = %170
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = load i32, ptr %9, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = add nsw i32 %194, %198
  %200 = load i32, ptr %8, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %201
  %203 = load i32, ptr %9, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [210 x i32], ptr %202, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = sub nsw i32 %199, %206
  store i32 %207, ptr %7, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %190, %170, %164
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %9, align 4, !tbaa !5
  br label %159, !llvm.loop !20

212:                                              ; preds = %163
  br label %213

213:                                              ; preds = %212, %157
  %214 = load i32, ptr %8, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %8, align 4, !tbaa !5
  br label %146, !llvm.loop !21

216:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %249, %216
  %218 = load i32, ptr %10, align 4, !tbaa !5
  %219 = load i32, ptr @n, align 4, !tbaa !5
  %220 = icmp slt i32 %218, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %217
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %252

222:                                              ; preds = %217
  %223 = load i32, ptr %10, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [210 x i8], ptr @sx, i64 0, i64 %224
  %226 = load i8, ptr %225, align 1, !tbaa !16, !range !18, !noundef !19
  %227 = trunc i8 %226 to i1
  br i1 %227, label %228, label %235

228:                                              ; preds = %222
  %229 = load i32, ptr %7, align 4, !tbaa !5
  %230 = load i32, ptr %10, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = sub nsw i32 %233, %229
  store i32 %234, ptr %232, align 4, !tbaa !5
  br label %235

235:                                              ; preds = %228, %222
  %236 = load i32, ptr %10, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [210 x i8], ptr @sy, i64 0, i64 %237
  %239 = load i8, ptr %238, align 1, !tbaa !16, !range !18, !noundef !19
  %240 = trunc i8 %239 to i1
  br i1 %240, label %241, label %248

241:                                              ; preds = %235
  %242 = load i32, ptr %7, align 4, !tbaa !5
  %243 = load i32, ptr %10, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = add nsw i32 %246, %242
  store i32 %247, ptr %245, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %241, %235
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %10, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %10, align 4, !tbaa !5
  br label %217, !llvm.loop !22

252:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %140, !llvm.loop !23

253:                                              ; preds = %144
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %6, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %6, align 4, !tbaa !5
  br label %134, !llvm.loop !24

257:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %283, %257
  %259 = load i32, ptr %11, align 4, !tbaa !5
  %260 = load i32, ptr @n, align 4, !tbaa !5
  %261 = icmp slt i32 %259, %260
  br i1 %261, label %263, label %262

262:                                              ; preds = %258
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %286

263:                                              ; preds = %258
  %264 = load i32, ptr %11, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [210 x i32], ptr @match, i64 0, i64 %265
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = icmp ne i32 %267, -1
  br i1 %268, label %269, label %282

269:                                              ; preds = %263
  %270 = load i32, ptr %11, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [210 x i32], ptr @match, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %274
  %276 = load i32, ptr %11, align 4, !tbaa !5
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [210 x i32], ptr %275, i64 0, i64 %277
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = load i32, ptr @ans, align 4, !tbaa !5
  %281 = sub nsw i32 %280, %279
  store i32 %281, ptr @ans, align 4, !tbaa !5
  br label %282

282:                                              ; preds = %269, %263
  br label %283

283:                                              ; preds = %282
  %284 = load i32, ptr %11, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %11, align 4, !tbaa !5
  br label %258, !llvm.loop !25

286:                                              ; preds = %262
  %287 = load i32, ptr @ans, align 4, !tbaa !5
  %288 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %287)
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3BoxEvT_S2_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIP3BoxET_S2_S2_(ptr noundef, ptr noundef) #4

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

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

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 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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS3Box", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !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"

%struct.Box = type { i32, i32 }

@a = external dso_local global [210 x %struct.Box], align 16
@n = external dso_local global i32, align 4
@g = external dso_local local_unnamed_addr global [210 x [210 x i32]], align 16
@lx = external dso_local local_unnamed_addr global [210 x i32], align 16
@ly = external dso_local local_unnamed_addr global [210 x i32], align 16
@match = external dso_local local_unnamed_addr global [210 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@sx = external dso_local local_unnamed_addr global [210 x i8], align 16
@sy = external dso_local local_unnamed_addr global [210 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z4pathi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %19, %.lr.ph ]
  %4 = getelementptr inbounds %struct.Box, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIP3BoxEvT_S2_(ptr noundef nonnull @a, ptr noundef nonnull %4)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds %struct.Box, ptr @a, i64 %6
  %8 = tail call noundef ptr @_ZSt6uniqueIP3BoxET_S2_S2_(ptr noundef nonnull @a, ptr noundef nonnull %7)
  %9 = ptrtoint ptr %8 to i64
  %10 = sub i64 %9, ptrtoint (ptr @a to i64)
  %11 = lshr exact i64 %10, 3
  %12 = trunc i64 %11 to i32
  store i32 %12, ptr @n, align 4, !tbaa !5
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph82.preheader, label %.thread

.thread:                                          ; preds = %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(840) @match, i8 -1, i64 840, i1 false)
  br label %._crit_edge103

.lr.ph82.preheader:                               ; preds = %._crit_edge
  %14 = and i64 %11, 2147483647
  %wide.trip.count115 = and i64 %11, 2147483647
  br label %.lr.ph82

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %15 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %indvars.iv
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %15, ptr noundef nonnull %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

21:                                               ; preds = %._crit_edge79
  store i32 %28, ptr @ans, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(840) @match, i8 -1, i64 840, i1 false)
  br i1 %13, label %.preheader72, label %._crit_edge103

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %._crit_edge79
  %indvars.iv112 = phi i64 [ 0, %.lr.ph82.preheader ], [ %indvars.iv.next113, %._crit_edge79 ]
  %indvars.iv107 = phi i64 [ 1, %.lr.ph82.preheader ], [ %indvars.iv.next108, %._crit_edge79 ]
  %22 = phi i32 [ %ans.promoted, %.lr.ph82.preheader ], [ %28, %._crit_edge79 ]
  %23 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %indvars.iv112
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds i8, ptr %23, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = mul nsw i32 %26, %24
  %28 = add nsw i32 %22, %27
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %29 = icmp ult i64 %indvars.iv.next113, %14
  br i1 %29, label %.lr.ph78, label %._crit_edge79

._crit_edge79:                                    ; preds = %38, %.lr.ph82
  %30 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %indvars.iv112
  store i32 %27, ptr %30, align 4, !tbaa !5
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count115
  br i1 %exitcond116.not, label %21, label %.lr.ph82, !llvm.loop !14

.lr.ph78:                                         ; preds = %.lr.ph82, %38
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %38 ], [ %indvars.iv107, %.lr.ph82 ]
  %31 = getelementptr inbounds [210 x %struct.Box], ptr @a, i64 0, i64 %indvars.iv109
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %.not66 = icmp sgt i32 %24, %32
  br i1 %.not66, label %38, label %33

33:                                               ; preds = %.lr.ph78
  %34 = getelementptr inbounds i8, ptr %31, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %.not67 = icmp sgt i32 %26, %35
  br i1 %.not67, label %38, label %36

36:                                               ; preds = %33
  %37 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %indvars.iv112, i64 %indvars.iv109
  store i32 %27, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %.lr.ph78, %33, %36
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count115
  br i1 %exitcond.not, label %._crit_edge79, label %.lr.ph78, !llvm.loop !15

.preheader72:                                     ; preds = %21, %._crit_edge97
  %.05798 = phi i32 [ %101, %._crit_edge97 ], [ 0, %21 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(210) @sx, i8 0, i64 210, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(210) @sy, i8 0, i64 210, i1 false)
  %39 = tail call noundef zeroext i1 @_Z4pathi(i32 noundef %.05798)
  br i1 %39, label %._crit_edge97, label %.preheader71

.preheader:                                       ; preds = %._crit_edge97
  %ans.promoted100.pre = load i32, ptr @ans, align 4, !tbaa !5
  %40 = icmp sgt i32 %102, 0
  br i1 %40, label %.lr.ph102.preheader, label %._crit_edge103

.lr.ph102.preheader:                              ; preds = %.preheader
  %wide.trip.count135 = zext nneg i32 %102 to i64
  %xtraiter153 = and i64 %wide.trip.count135, 1
  %41 = icmp eq i32 %102, 1
  br i1 %41, label %._crit_edge103.loopexit.unr-lcssa, label %.lr.ph102.preheader.new

.lr.ph102.preheader.new:                          ; preds = %.lr.ph102.preheader
  %unroll_iter156 = and i64 %wide.trip.count135, 2147483646
  br label %.lr.ph102

.loopexit70:                                      ; preds = %100, %.preheader71, %.preheader69
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(210) @sx, i8 0, i64 210, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(210) @sy, i8 0, i64 210, i1 false)
  %42 = tail call noundef zeroext i1 @_Z4pathi(i32 noundef %.05798)
  br i1 %42, label %._crit_edge97, label %.preheader71, !llvm.loop !16

.preheader71:                                     ; preds = %.preheader72, %.loopexit70
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph91.preheader, label %.loopexit70

.lr.ph91.preheader:                               ; preds = %.preheader71
  %wide.trip.count125 = zext nneg i32 %43 to i64
  %xtraiter = and i64 %wide.trip.count125, 1
  %45 = icmp eq i32 %43, 1
  %unroll_iter = and i64 %wide.trip.count125, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph91

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %..loopexit_crit_edge.us
  %indvars.iv122 = phi i64 [ 0, %.lr.ph91.preheader ], [ %indvars.iv.next123, %..loopexit_crit_edge.us ]
  %.05689.us = phi i32 [ 1061109567, %.lr.ph91.preheader ], [ %.3.us, %..loopexit_crit_edge.us ]
  %46 = getelementptr inbounds [210 x i8], ptr @sx, i64 0, i64 %indvars.iv122
  %47 = load i8, ptr %46, align 1, !tbaa !17, !range !19, !noundef !20
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %.preheader68.us, label %..loopexit_crit_edge.us

..loopexit_crit_edge.us.loopexit.unr-lcssa:       ; preds = %83, %.preheader68.us
  %.2.us.lcssa.ph = phi i32 [ poison, %.preheader68.us ], [ %.2.us.1, %83 ]
  %indvars.iv117.unr = phi i64 [ 0, %.preheader68.us ], [ %indvars.iv.next118.1, %83 ]
  %.185.us.unr = phi i32 [ %.05689.us, %.preheader68.us ], [ %.2.us.1, %83 ]
  br i1 %lcmp.mod.not, label %..loopexit_crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa
  %49 = getelementptr inbounds [210 x i8], ptr @sy, i64 0, i64 %indvars.iv117.unr
  %50 = load i8, ptr %49, align 1, !tbaa !17, !range !19, !noundef !20
  %51 = trunc nuw i8 %50 to i1
  br i1 %51, label %..loopexit_crit_edge.us, label %52

52:                                               ; preds = %.epil.preheader
  %53 = load i32, ptr %84, align 4, !tbaa !5
  %54 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %indvars.iv117.unr
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, %53
  %57 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %indvars.iv122, i64 %indvars.iv117.unr
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sub i32 %56, %58
  %spec.select.us.epil = tail call i32 @llvm.smin.i32(i32 %.185.us.unr, i32 %59)
  br label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa, %52, %.epil.preheader, %.lr.ph91
  %.3.us = phi i32 [ %.05689.us, %.lr.ph91 ], [ %.2.us.lcssa.ph, %..loopexit_crit_edge.us.loopexit.unr-lcssa ], [ %.185.us.unr, %.epil.preheader ], [ %spec.select.us.epil, %52 ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125
  br i1 %exitcond126.not, label %.preheader69, label %.lr.ph91, !llvm.loop !21

.preheader68.us.new:                              ; preds = %.preheader68.us, %83
  %indvars.iv117 = phi i64 [ %indvars.iv.next118.1, %83 ], [ 0, %.preheader68.us ]
  %.185.us = phi i32 [ %.2.us.1, %83 ], [ %.05689.us, %.preheader68.us ]
  %niter = phi i64 [ %niter.next.1, %83 ], [ 0, %.preheader68.us ]
  %60 = getelementptr inbounds [210 x i8], ptr @sy, i64 0, i64 %indvars.iv117
  %61 = load i8, ptr %60, align 2, !tbaa !17, !range !19, !noundef !20
  %62 = trunc nuw i8 %61 to i1
  br i1 %62, label %71, label %63

63:                                               ; preds = %.preheader68.us.new
  %64 = load i32, ptr %84, align 4, !tbaa !5
  %65 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %indvars.iv117
  %66 = load i32, ptr %65, align 8, !tbaa !5
  %67 = add nsw i32 %66, %64
  %68 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %indvars.iv122, i64 %indvars.iv117
  %69 = load i32, ptr %68, align 8, !tbaa !5
  %70 = sub i32 %67, %69
  %spec.select.us = tail call i32 @llvm.smin.i32(i32 %.185.us, i32 %70)
  br label %71

71:                                               ; preds = %63, %.preheader68.us.new
  %.2.us = phi i32 [ %.185.us, %.preheader68.us.new ], [ %spec.select.us, %63 ]
  %indvars.iv.next118 = or disjoint i64 %indvars.iv117, 1
  %72 = getelementptr inbounds [210 x i8], ptr @sy, i64 0, i64 %indvars.iv.next118
  %73 = load i8, ptr %72, align 1, !tbaa !17, !range !19, !noundef !20
  %74 = trunc nuw i8 %73 to i1
  br i1 %74, label %83, label %75

75:                                               ; preds = %71
  %76 = load i32, ptr %84, align 4, !tbaa !5
  %77 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %indvars.iv.next118
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, %76
  %80 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %indvars.iv122, i64 %indvars.iv.next118
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sub i32 %79, %81
  %spec.select.us.1 = tail call i32 @llvm.smin.i32(i32 %.2.us, i32 %82)
  br label %83

83:                                               ; preds = %75, %71
  %.2.us.1 = phi i32 [ %.2.us, %71 ], [ %spec.select.us.1, %75 ]
  %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.preheader68.us.new, !llvm.loop !22

.preheader68.us:                                  ; preds = %.lr.ph91
  %84 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %indvars.iv122
  br i1 %45, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.preheader68.us.new

.preheader69:                                     ; preds = %..loopexit_crit_edge.us
  br i1 %44, label %.lr.ph96.preheader, label %.loopexit70

.lr.ph96.preheader:                               ; preds = %.preheader69
  %wide.trip.count130 = zext nneg i32 %43 to i64
  br label %.lr.ph96

.lr.ph96:                                         ; preds = %.lr.ph96.preheader, %100
  %indvars.iv127 = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next128, %100 ]
  %85 = getelementptr inbounds [210 x i8], ptr @sx, i64 0, i64 %indvars.iv127
  %86 = load i8, ptr %85, align 1, !tbaa !17, !range !19, !noundef !20
  %87 = trunc nuw i8 %86 to i1
  br i1 %87, label %88, label %92

88:                                               ; preds = %.lr.ph96
  %89 = getelementptr inbounds [210 x i32], ptr @lx, i64 0, i64 %indvars.iv127
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sub nsw i32 %90, %.3.us
  store i32 %91, ptr %89, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %88, %.lr.ph96
  %93 = getelementptr inbounds [210 x i8], ptr @sy, i64 0, i64 %indvars.iv127
  %94 = load i8, ptr %93, align 1, !tbaa !17, !range !19, !noundef !20
  %95 = trunc nuw i8 %94 to i1
  br i1 %95, label %96, label %100

96:                                               ; preds = %92
  %97 = getelementptr inbounds [210 x i32], ptr @ly, i64 0, i64 %indvars.iv127
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, %.3.us
  store i32 %99, ptr %97, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %92, %96
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %exitcond131.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count130
  br i1 %exitcond131.not, label %.loopexit70, label %.lr.ph96, !llvm.loop !23

._crit_edge97:                                    ; preds = %.loopexit70, %.preheader72
  %101 = add nuw nsw i32 %.05798, 1
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %.preheader72, label %.preheader, !llvm.loop !24

._crit_edge103.loopexit.unr-lcssa:                ; preds = %129, %.lr.ph102.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph102.preheader ], [ %130, %129 ]
  %indvars.iv132.unr = phi i64 [ 0, %.lr.ph102.preheader ], [ %indvars.iv.next133.1, %129 ]
  %.unr = phi i32 [ %ans.promoted100.pre, %.lr.ph102.preheader ], [ %130, %129 ]
  %lcmp.mod154.not = icmp eq i64 %xtraiter153, 0
  br i1 %lcmp.mod154.not, label %._crit_edge103, label %.lr.ph102.epil

.lr.ph102.epil:                                   ; preds = %._crit_edge103.loopexit.unr-lcssa
  %104 = getelementptr inbounds [210 x i32], ptr @match, i64 0, i64 %indvars.iv132.unr
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %.not.epil = icmp eq i32 %105, -1
  br i1 %.not.epil, label %._crit_edge103, label %106

106:                                              ; preds = %.lr.ph102.epil
  %107 = sext i32 %105 to i64
  %108 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %107, i64 %indvars.iv132.unr
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = sub nsw i32 %.unr, %109
  store i32 %110, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge103

._crit_edge103:                                   ; preds = %._crit_edge103.loopexit.unr-lcssa, %106, %.lr.ph102.epil, %.thread, %21, %.preheader
  %111 = phi i32 [ %ans.promoted100.pre, %.preheader ], [ %ans.promoted, %.thread ], [ %28, %21 ], [ %.lcssa.ph, %._crit_edge103.loopexit.unr-lcssa ], [ %.unr, %.lr.ph102.epil ], [ %110, %106 ]
  %112 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %111)
  ret i32 0

.lr.ph102:                                        ; preds = %129, %.lr.ph102.preheader.new
  %indvars.iv132 = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %indvars.iv.next133.1, %129 ]
  %113 = phi i32 [ %ans.promoted100.pre, %.lr.ph102.preheader.new ], [ %130, %129 ]
  %niter157 = phi i64 [ 0, %.lr.ph102.preheader.new ], [ %niter157.next.1, %129 ]
  %114 = getelementptr inbounds [210 x i32], ptr @match, i64 0, i64 %indvars.iv132
  %115 = load i32, ptr %114, align 8, !tbaa !5
  %.not = icmp eq i32 %115, -1
  br i1 %.not, label %.lr.ph102.1, label %116

116:                                              ; preds = %.lr.ph102
  %117 = sext i32 %115 to i64
  %118 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %117, i64 %indvars.iv132
  %119 = load i32, ptr %118, align 8, !tbaa !5
  %120 = sub nsw i32 %113, %119
  store i32 %120, ptr @ans, align 4, !tbaa !5
  br label %.lr.ph102.1

.lr.ph102.1:                                      ; preds = %.lr.ph102, %116
  %121 = phi i32 [ %113, %.lr.ph102 ], [ %120, %116 ]
  %indvars.iv.next133 = or disjoint i64 %indvars.iv132, 1
  %122 = getelementptr inbounds [210 x i32], ptr @match, i64 0, i64 %indvars.iv.next133
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %.not.1 = icmp eq i32 %123, -1
  br i1 %.not.1, label %129, label %124

124:                                              ; preds = %.lr.ph102.1
  %125 = sext i32 %123 to i64
  %126 = getelementptr inbounds [210 x [210 x i32]], ptr @g, i64 0, i64 %125, i64 %indvars.iv.next133
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sub nsw i32 %121, %127
  store i32 %128, ptr @ans, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %124, %.lr.ph102.1
  %130 = phi i32 [ %121, %.lr.ph102.1 ], [ %128, %124 ]
  %indvars.iv.next133.1 = add nuw nsw i64 %indvars.iv132, 2
  %niter157.next.1 = add i64 %niter157, 2
  %niter157.ncmp.1 = icmp eq i64 %niter157.next.1, %unroll_iter156
  br i1 %niter157.ncmp.1, label %._crit_edge103.loopexit.unr-lcssa, label %.lr.ph102, !llvm.loop !25
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3BoxEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIP3BoxET_S2_S2_(ptr noundef, ptr noundef) 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 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 #2 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !6, i64 0}
!12 = !{!"_ZTS3Box", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


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