; LLVM IR from tangjz/acm-icpc :: lydsy (3928)

; 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.Monster = type { i32, i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@qn = external dso_local global i32, align 4
@que = external dso_local global [302 x i32], align 16
@suf = external dso_local global [302 x i32], align 16
@p = external dso_local global [302 x [302 x i32]], align 16
@f = external dso_local global [302 x [302 x i32]], align 16
@a = external dso_local global [302 x %struct.Monster], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 ptr, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %14

14:                                               ; preds = %317, %0
  %15 = load i32, ptr @t, align 4, !tbaa !5
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr @t, align 4, !tbaa !5
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %323

18:                                               ; preds = %14
  call void @llvm.memset.p0.i64(ptr align 16 @p, i8 -1, i64 364816, i1 false)
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %47, %18
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %27
  %29 = getelementptr inbounds %struct.Monster, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.Monster, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.Monster, ptr %36, i32 0, i32 2
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %29, ptr noundef %33, ptr noundef %37)
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.Monster, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [302 x i32], ptr @que, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %25
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !11

50:                                               ; preds = %24
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds %struct.Monster, ptr @a, i64 %52
  call void @_ZSt4sortIP7MonsterEvT_S2_(ptr noundef @a, ptr noundef %53)
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr @que, i64 %55
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %56)
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr @que, i64 %58
  %60 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %59)
  %61 = ptrtoint ptr %60 to i64
  %62 = sub i64 %61, ptrtoint (ptr @que to i64)
  %63 = sdiv exact i64 %62, 4
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr @qn, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %76, %50
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = load i32, ptr @qn, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %79

70:                                               ; preds = %65
  %71 = load i32, ptr @qn, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %74
  store i32 %72, ptr %75, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %70
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %3, align 4, !tbaa !5
  br label %65, !llvm.loop !13

79:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %180, %79
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %183

85:                                               ; preds = %80
  %86 = load i32, ptr @qn, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr @que, i64 %87
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %90
  %92 = getelementptr inbounds %struct.Monster, ptr %91, i32 0, i32 0
  %93 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %88, ptr noundef nonnull align 4 dereferenceable(4) %92)
  %94 = ptrtoint ptr %93 to i64
  %95 = sub i64 %94, ptrtoint (ptr @que to i64)
  %96 = sdiv exact i64 %95, 4
  %97 = add nsw i64 %96, 1
  %98 = trunc i64 %97 to i32
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.Monster, ptr %101, i32 0, i32 0
  store i32 %98, ptr %102, align 4, !tbaa !14
  %103 = load i32, ptr @qn, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr @que, i64 %104
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.Monster, ptr %108, i32 0, i32 1
  %110 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %105, ptr noundef nonnull align 4 dereferenceable(4) %109)
  %111 = ptrtoint ptr %110 to i64
  %112 = sub i64 %111, ptrtoint (ptr @que to i64)
  %113 = sdiv exact i64 %112, 4
  %114 = add nsw i64 %113, 1
  %115 = trunc i64 %114 to i32
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Monster, ptr %118, i32 0, i32 1
  store i32 %115, ptr %119, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %176, %85
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.Monster, ptr %124, i32 0, i32 0
  %126 = load i32, ptr %125, align 4, !tbaa !14
  %127 = icmp slt i32 %121, %126
  br i1 %127, label %129, label %128

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

129:                                              ; preds = %120
  %130 = load i32, ptr %4, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %131
  %133 = getelementptr inbounds %struct.Monster, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !9
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = icmp sge i32 %134, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %129
  br label %176

141:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.Monster, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %7, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %164, %141
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp sle i32 %149, %153
  br i1 %154, label %156, label %155

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

156:                                              ; preds = %148
  %157 = load i32, ptr %4, align 4, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [302 x [302 x i32]], ptr @p, i64 0, i64 %159
  %161 = load i32, ptr %7, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [302 x i32], ptr %160, i64 0, i64 %162
  store i32 %157, ptr %163, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %156
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %7, align 4, !tbaa !5
  br label %148, !llvm.loop !15

167:                                              ; preds = %155
  %168 = load i32, ptr %4, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %169
  %171 = getelementptr inbounds %struct.Monster, ptr %170, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %174
  store i32 %172, ptr %175, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %167, %140
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %6, align 4, !tbaa !5
  br label %120, !llvm.loop !16

179:                                              ; preds = %128
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %4, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %4, align 4, !tbaa !5
  br label %80, !llvm.loop !17

183:                                              ; preds = %84
  %184 = load i32, ptr @qn, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr @qn, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %314, %183
  %187 = load i32, ptr %8, align 4, !tbaa !5
  %188 = load i32, ptr @qn, align 4, !tbaa !5
  %189 = icmp sle i32 %187, %188
  br i1 %189, label %191, label %190

190:                                              ; preds = %186
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %317

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

192:                                              ; preds = %310, %191
  %193 = load i32, ptr %9, align 4, !tbaa !5
  %194 = load i32, ptr @qn, align 4, !tbaa !5
  %195 = load i32, ptr %8, align 4, !tbaa !5
  %196 = sub nsw i32 %194, %195
  %197 = icmp sle i32 %193, %196
  br i1 %197, label %199, label %198

198:                                              ; preds = %192
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %313

199:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %200 = load i32, ptr %9, align 4, !tbaa !5
  %201 = load i32, ptr %8, align 4, !tbaa !5
  %202 = add nsw i32 %200, %201
  store i32 %202, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %203 = load i32, ptr %9, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [302 x [302 x i32]], ptr @p, i64 0, i64 %204
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [302 x i32], ptr %205, i64 0, i64 %207
  store ptr %208, ptr %11, align 8, !tbaa !18
  %209 = load ptr, ptr %11, align 8, !tbaa !18
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = icmp eq i32 %210, -1
  br i1 %211, label %212, label %219

212:                                              ; preds = %199
  %213 = load i32, ptr %9, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %214
  %216 = load i32, ptr %10, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [302 x i32], ptr %215, i64 0, i64 %217
  store i32 0, ptr %218, align 4, !tbaa !5
  store i32 24, ptr %5, align 4
  br label %307

219:                                              ; preds = %199
  %220 = load i32, ptr %9, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %221
  %223 = load i32, ptr %10, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [302 x i32], ptr %222, i64 0, i64 %224
  store i32 1061109567, ptr %225, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %226 = load ptr, ptr %11, align 8, !tbaa !18
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %228
  %230 = getelementptr inbounds %struct.Monster, ptr %229, i32 0, i32 0
  %231 = load i32, ptr %230, align 4, !tbaa !14
  store i32 %231, ptr %12, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %303, %219
  %233 = load i32, ptr %12, align 4, !tbaa !5
  %234 = load ptr, ptr %11, align 8, !tbaa !18
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %236
  %238 = getelementptr inbounds %struct.Monster, ptr %237, i32 0, i32 1
  %239 = load i32, ptr %238, align 4, !tbaa !9
  %240 = icmp sle i32 %233, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %232
  store i32 25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %306

242:                                              ; preds = %232
  %243 = load i32, ptr %9, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %244
  %246 = load i32, ptr %10, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [302 x i32], ptr %245, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = load i32, ptr %9, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %251
  %253 = load i32, ptr %12, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [302 x i32], ptr %252, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = load i32, ptr %12, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %258
  %260 = load i32, ptr %10, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [302 x i32], ptr %259, i64 0, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !5
  %264 = add nsw i32 %256, %263
  %265 = load ptr, ptr %11, align 8, !tbaa !18
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %267
  %269 = getelementptr inbounds %struct.Monster, ptr %268, i32 0, i32 2
  %270 = load i32, ptr %269, align 4, !tbaa !20
  %271 = add nsw i32 %264, %270
  %272 = icmp sgt i32 %249, %271
  br i1 %272, label %273, label %302

273:                                              ; preds = %242
  %274 = load i32, ptr %9, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %275
  %277 = load i32, ptr %12, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [302 x i32], ptr %276, i64 0, i64 %278
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = load i32, ptr %12, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %282
  %284 = load i32, ptr %10, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [302 x i32], ptr %283, i64 0, i64 %285
  %287 = load i32, ptr %286, align 4, !tbaa !5
  %288 = add nsw i32 %280, %287
  %289 = load ptr, ptr %11, align 8, !tbaa !18
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %291
  %293 = getelementptr inbounds %struct.Monster, ptr %292, i32 0, i32 2
  %294 = load i32, ptr %293, align 4, !tbaa !20
  %295 = add nsw i32 %288, %294
  %296 = load i32, ptr %9, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %297
  %299 = load i32, ptr %10, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [302 x i32], ptr %298, i64 0, i64 %300
  store i32 %295, ptr %301, align 4, !tbaa !5
  br label %302

302:                                              ; preds = %273, %242
  br label %303

303:                                              ; preds = %302
  %304 = load i32, ptr %12, align 4, !tbaa !5
  %305 = add nsw i32 %304, 1
  store i32 %305, ptr %12, align 4, !tbaa !5
  br label %232, !llvm.loop !21

306:                                              ; preds = %241
  store i32 0, ptr %5, align 4
  br label %307

307:                                              ; preds = %306, %212
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %308 = load i32, ptr %5, align 4
  switch i32 %308, label %324 [
    i32 0, label %309
    i32 24, label %310
  ]

309:                                              ; preds = %307
  br label %310

310:                                              ; preds = %309, %307
  %311 = load i32, ptr %9, align 4, !tbaa !5
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %9, align 4, !tbaa !5
  br label %192, !llvm.loop !22

313:                                              ; preds = %198
  br label %314

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

317:                                              ; preds = %190
  %318 = load i32, ptr @qn, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [302 x i32], ptr @f, i64 0, i64 %319
  %321 = load i32, ptr %320, align 4, !tbaa !5
  %322 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %321)
  br label %14, !llvm.loop !24

323:                                              ; preds = %14
  ret i32 0

324:                                              ; preds = %307
  unreachable
}

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

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

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }

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

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


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

%struct.Monster = type { i32, i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@qn = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [302 x i32], align 16
@suf = external dso_local local_unnamed_addr global [302 x i32], align 16
@p = external dso_local local_unnamed_addr global [302 x [302 x i32]], align 16
@f = external dso_local local_unnamed_addr global [302 x [302 x i32]], align 16
@a = external dso_local global [302 x %struct.Monster], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not105 = icmp eq i32 %2, 0
  br i1 %.not105, label %._crit_edge108, label %.lr.ph107

.lr.ph107:                                        ; preds = %0, %._crit_edge104
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(364816) @p, i8 -1, i64 364816, i1 false)
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.lr.ph107.._crit_edge_crit_edge

.lr.ph107.._crit_edge_crit_edge:                  ; preds = %.lr.ph107
  %.pre143 = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph107.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre143, %.lr.ph107.._crit_edge_crit_edge ], [ %30, %.lr.ph ]
  %7 = getelementptr inbounds %struct.Monster, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIP7MonsterEvT_S2_(ptr noundef nonnull @a, ptr noundef nonnull %7)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds i32, ptr @que, i64 %9
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %10)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds i32, ptr @que, i64 %12
  %14 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %13)
  %15 = ptrtoint ptr %14 to i64
  %16 = sub i64 %15, ptrtoint (ptr @que to i64)
  %17 = lshr exact i64 %16, 2
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr @qn, align 4, !tbaa !5
  %.not7382 = icmp slt i32 %18, 0
  br i1 %.not7382, label %.preheader80, label %.lr.ph85

.lr.ph85:                                         ; preds = %._crit_edge
  %19 = add nuw i32 %18, 1
  %wide.trip.count = zext i32 %19 to i64
  %min.iters.check148 = icmp ult i32 %18, 7
  br i1 %min.iters.check148, label %scalar.ph147.preheader, label %vector.ph149

scalar.ph147.preheader:                           ; preds = %middle.block146, %.lr.ph85
  %indvars.iv111.ph = phi i64 [ 0, %.lr.ph85 ], [ %n.vec151, %middle.block146 ]
  br label %scalar.ph147

vector.ph149:                                     ; preds = %.lr.ph85
  %n.vec151 = and i64 %wide.trip.count, 4294967288
  %broadcast.splatinsert155 = insertelement <4 x i32> poison, i32 %19, i64 0
  %broadcast.splat156 = shufflevector <4 x i32> %broadcast.splatinsert155, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body153

vector.body153:                                   ; preds = %vector.body153, %vector.ph149
  %index154 = phi i64 [ 0, %vector.ph149 ], [ %index.next157, %vector.body153 ]
  %20 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %index154
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <4 x i32> %broadcast.splat156, ptr %20, align 16, !tbaa !5
  store <4 x i32> %broadcast.splat156, ptr %21, align 16, !tbaa !5
  %index.next157 = add nuw i64 %index154, 8
  %22 = icmp eq i64 %index.next157, %n.vec151
  br i1 %22, label %middle.block146, label %vector.body153, !llvm.loop !9

middle.block146:                                  ; preds = %vector.body153
  %cmp.n158 = icmp eq i64 %n.vec151, %wide.trip.count
  br i1 %cmp.n158, label %.preheader80, label %scalar.ph147.preheader

.lr.ph:                                           ; preds = %.lr.ph107, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph107 ]
  %23 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %indvars.iv
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = getelementptr inbounds i8, ptr %23, i64 8
  %26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef nonnull %25)
  %27 = load i32, ptr %24, align 4, !tbaa !13
  %28 = getelementptr inbounds [302 x i32], ptr @que, i64 0, i64 %indvars.iv
  store i32 %27, ptr %28, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !15

.preheader80:                                     ; preds = %scalar.ph147, %middle.block146, %._crit_edge
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph92, label %._crit_edge93

scalar.ph147:                                     ; preds = %scalar.ph147.preheader, %scalar.ph147
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %scalar.ph147 ], [ %indvars.iv111.ph, %scalar.ph147.preheader ]
  %34 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %indvars.iv111
  store i32 %19, ptr %34, align 4, !tbaa !5
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count
  br i1 %exitcond.not, label %.preheader80, label %scalar.ph147, !llvm.loop !16

._crit_edge93.loopexit:                           ; preds = %._crit_edge90
  %.pre = load i32, ptr @qn, align 4, !tbaa !5
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit, %.preheader80
  %35 = phi i32 [ %.pre, %._crit_edge93.loopexit ], [ %18, %.preheader80 ]
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @qn, align 4, !tbaa !5
  %.not74102 = icmp slt i32 %35, -1
  br i1 %.not74102, label %._crit_edge93.._crit_edge104_crit_edge, label %.preheader79.preheader

._crit_edge93.._crit_edge104_crit_edge:           ; preds = %._crit_edge93
  %.pre144 = sext i32 %36 to i64
  br label %._crit_edge104

.preheader79.preheader:                           ; preds = %._crit_edge93
  %37 = add i32 %35, 2
  %38 = zext nneg i32 %36 to i64
  %wide.trip.count141 = zext i32 %37 to i64
  br label %.preheader79

.lr.ph92:                                         ; preds = %.preheader80, %._crit_edge90
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %._crit_edge90 ], [ 0, %.preheader80 ]
  %39 = load i32, ptr @qn, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr @que, i64 %40
  %42 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %indvars.iv123
  %43 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %41, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %44 = ptrtoint ptr %43 to i64
  %45 = sub i64 %44, ptrtoint (ptr @que to i64)
  %46 = lshr exact i64 %45, 2
  %47 = trunc i64 %46 to i32
  %48 = add i32 %47, 1
  store i32 %48, ptr %42, align 4, !tbaa !17
  %49 = load i32, ptr @qn, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr @que, i64 %50
  %52 = getelementptr inbounds i8, ptr %42, i64 4
  %53 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %51, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %54 = ptrtoint ptr %53 to i64
  %55 = sub i64 %54, ptrtoint (ptr @que to i64)
  %56 = lshr i64 %55, 2
  %57 = trunc i64 %56 to i32
  %58 = add i32 %57, 1
  store i32 %58, ptr %52, align 4, !tbaa !13
  %59 = load i32, ptr %42, align 4, !tbaa !17
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph89.preheader, label %._crit_edge90

.lr.ph89.preheader:                               ; preds = %.lr.ph92
  %61 = sext i32 %58 to i64
  %wide.trip.count121 = zext nneg i32 %59 to i64
  %62 = trunc nuw nsw i64 %indvars.iv123 to i32
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %62, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %.lr.ph89

._crit_edge90:                                    ; preds = %76, %.lr.ph92
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next124, %64
  br i1 %65, label %.lr.ph92, label %._crit_edge93.loopexit, !llvm.loop !18

.lr.ph89:                                         ; preds = %.lr.ph89.preheader, %76
  %indvars.iv118 = phi i64 [ 0, %.lr.ph89.preheader ], [ %indvars.iv.next119, %76 ]
  %66 = getelementptr inbounds [302 x i32], ptr @suf, i64 0, i64 %indvars.iv118
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not77 = icmp slt i32 %58, %67
  br i1 %.not77, label %.preheader.preheader, label %76

.preheader.preheader:                             ; preds = %.lr.ph89
  %reass.sub = sub i32 %67, %57
  %68 = add i32 %reass.sub, -2
  %69 = zext i32 %68 to i64
  %70 = add nuw nsw i64 %69, 1
  %min.iters.check = icmp ult i32 %68, 7
  br i1 %min.iters.check, label %.preheader.preheader160, label %vector.ph

.preheader.preheader160:                          ; preds = %middle.block, %.preheader.preheader
  %indvars.iv114.ph = phi i64 [ %61, %.preheader.preheader ], [ %ind.end, %middle.block ]
  br label %.preheader

vector.ph:                                        ; preds = %.preheader.preheader
  %n.vec = and i64 %70, 8589934584
  %ind.end = add nsw i64 %n.vec, %61
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %61
  %71 = add nsw i64 %offset.idx, 1
  %72 = getelementptr inbounds [302 x [302 x i32]], ptr @p, i64 0, i64 %indvars.iv118, i64 %71
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  store <4 x i32> %broadcast.splat, ptr %72, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %73, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %74 = icmp eq i64 %index.next, %n.vec
  br i1 %74, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %70, %n.vec
  br i1 %cmp.n, label %.loopexit159, label %.preheader.preheader160

.loopexit159:                                     ; preds = %.preheader, %middle.block
  store i32 %58, ptr %66, align 4, !tbaa !5
  br label %76

.preheader:                                       ; preds = %.preheader.preheader160, %.preheader
  %indvars.iv114 = phi i64 [ %indvars.iv.next115, %.preheader ], [ %indvars.iv114.ph, %.preheader.preheader160 ]
  %indvars.iv.next115 = add nsw i64 %indvars.iv114, 1
  %75 = getelementptr inbounds [302 x [302 x i32]], ptr @p, i64 0, i64 %indvars.iv118, i64 %indvars.iv.next115
  store i32 %62, ptr %75, align 4, !tbaa !5
  %lftr.wideiv = trunc i64 %indvars.iv.next115 to i32
  %exitcond117.not = icmp eq i32 %67, %lftr.wideiv
  br i1 %exitcond117.not, label %.loopexit159, label %.preheader, !llvm.loop !20

76:                                               ; preds = %.lr.ph89, %.loopexit159
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
  br i1 %exitcond122.not, label %._crit_edge90, label %.lr.ph89, !llvm.loop !21

.preheader79:                                     ; preds = %.preheader79.preheader, %._crit_edge101
  %indvars.iv138 = phi i64 [ 0, %.preheader79.preheader ], [ %indvars.iv.next139, %._crit_edge101 ]
  %indvars.iv134 = phi i32 [ %37, %.preheader79.preheader ], [ %indvars.iv.next135, %._crit_edge101 ]
  %.not7598 = icmp ugt i64 %indvars.iv138, %38
  br i1 %.not7598, label %._crit_edge101, label %.lr.ph100.preheader

.lr.ph100.preheader:                              ; preds = %.preheader79
  %wide.trip.count136 = zext i32 %indvars.iv134 to i64
  br label %.lr.ph100

._crit_edge104:                                   ; preds = %._crit_edge101, %._crit_edge93.._crit_edge104_crit_edge
  %.pre-phi145 = phi i64 [ %.pre144, %._crit_edge93.._crit_edge104_crit_edge ], [ %38, %._crit_edge101 ]
  %77 = getelementptr inbounds [302 x i32], ptr @f, i64 0, i64 %.pre-phi145
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %78)
  %80 = load i32, ptr @t, align 4, !tbaa !5
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %80, 0
  br i1 %.not, label %._crit_edge108, label %.lr.ph107, !llvm.loop !22

._crit_edge101:                                   ; preds = %.loopexit, %.preheader79
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %indvars.iv.next135 = add i32 %indvars.iv134, -1
  %exitcond142 = icmp eq i64 %indvars.iv.next139, %wide.trip.count141
  br i1 %exitcond142, label %._crit_edge104, label %.preheader79, !llvm.loop !23

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %.loopexit
  %indvars.iv131 = phi i64 [ 0, %.lr.ph100.preheader ], [ %indvars.iv.next132, %.loopexit ]
  %82 = add nuw nsw i64 %indvars.iv131, %indvars.iv138
  %83 = getelementptr inbounds [302 x [302 x i32]], ptr @p, i64 0, i64 %indvars.iv131, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp eq i32 %84, -1
  %86 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv131, i64 %82
  br i1 %85, label %87, label %88

87:                                               ; preds = %.lr.ph100
  store i32 0, ptr %86, align 4, !tbaa !5
  br label %.loopexit

88:                                               ; preds = %.lr.ph100
  store i32 1061109567, ptr %86, align 4, !tbaa !5
  %89 = sext i32 %84 to i64
  %90 = getelementptr inbounds [302 x %struct.Monster], ptr @a, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !17
  %92 = getelementptr inbounds i8, ptr %90, i64 4
  %93 = load i32, ptr %92, align 4, !tbaa !13
  %.not7694 = icmp sgt i32 %91, %93
  br i1 %.not7694, label %.loopexit, label %.lr.ph97

.lr.ph97:                                         ; preds = %88
  %94 = getelementptr inbounds i8, ptr %90, i64 8
  %95 = load i32, ptr %94, align 4, !tbaa !24
  %96 = sext i32 %91 to i64
  %97 = add i32 %93, 1
  %98 = sub i32 %97, %91
  %xtraiter = and i32 %98, 1
  %99 = icmp eq i32 %93, %91
  br i1 %99, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph97.new

.lr.ph97.new:                                     ; preds = %.lr.ph97
  %unroll_iter = and i32 %98, -2
  br label %100

100:                                              ; preds = %120, %.lr.ph97.new
  %indvars.iv126 = phi i64 [ %96, %.lr.ph97.new ], [ %indvars.iv.next127.1, %120 ]
  %101 = phi i32 [ 1061109567, %.lr.ph97.new ], [ %121, %120 ]
  %niter = phi i32 [ 0, %.lr.ph97.new ], [ %niter.next.1, %120 ]
  %102 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv131, i64 %indvars.iv126
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv126, i64 %82
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, %103
  %107 = add nsw i32 %106, %95
  %108 = icmp sgt i32 %101, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %100
  store i32 %107, ptr %86, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %100, %109
  %111 = phi i32 [ %101, %100 ], [ %107, %109 ]
  %indvars.iv.next127 = add nsw i64 %indvars.iv126, 1
  %112 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv131, i64 %indvars.iv.next127
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv.next127, i64 %82
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = add nsw i32 %115, %113
  %117 = add nsw i32 %116, %95
  %118 = icmp sgt i32 %111, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %110
  store i32 %117, ptr %86, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %119, %110
  %121 = phi i32 [ %111, %110 ], [ %117, %119 ]
  %indvars.iv.next127.1 = add nsw i64 %indvars.iv126, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %100, !llvm.loop !25

.loopexit.loopexit.unr-lcssa:                     ; preds = %120, %.lr.ph97
  %indvars.iv126.unr = phi i64 [ %96, %.lr.ph97 ], [ %indvars.iv.next127.1, %120 ]
  %.unr = phi i32 [ 1061109567, %.lr.ph97 ], [ %121, %120 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.epil.preheader

.epil.preheader:                                  ; preds = %.loopexit.loopexit.unr-lcssa
  %122 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv131, i64 %indvars.iv126.unr
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = getelementptr inbounds [302 x [302 x i32]], ptr @f, i64 0, i64 %indvars.iv126.unr, i64 %82
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, %123
  %127 = add nsw i32 %126, %95
  %128 = icmp sgt i32 %.unr, %127
  br i1 %128, label %129, label %.loopexit

129:                                              ; preds = %.epil.preheader
  store i32 %127, ptr %86, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %129, %.epil.preheader, %88, %87
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count136
  br i1 %exitcond137.not, label %._crit_edge101, label %.lr.ph100, !llvm.loop !26

._crit_edge108:                                   ; preds = %._crit_edge104, %0
  ret i32 0
}

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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" }

!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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = !{!14, !6, i64 4}
!14 = !{!"_ZTS7Monster", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !12, !11}
!17 = !{!14, !6, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !11, !12}
!20 = distinct !{!20, !10, !12, !11}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = !{!14, !6, i64 8}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}


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