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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sq = external dso_local global i32, align 4
@blk = external dso_local global i32, align 4
@perm = external dso_local global [50003 x i32], align 16
@pos = external dso_local global [50003 x i32], align 16
@mx = external dso_local global i32, align 4
@ans = external dso_local global [50003 x i32], align 16
@tot = external dso_local global i32, align 4
@que = external dso_local global [50003 x %struct.Query], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  br label %17

17:                                               ; preds = %24, %0
  %18 = load i32, ptr @sq, align 4, !tbaa !5
  %19 = load i32, ptr @sq, align 4, !tbaa !5
  %20 = mul nsw i32 %18, %19
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %23, label %27

23:                                               ; preds = %17
  br label %24

24:                                               ; preds = %23
  %25 = load i32, ptr @sq, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @sq, align 4, !tbaa !5
  br label %17, !llvm.loop !9

27:                                               ; preds = %17
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sub nsw i32 %28, 1
  %30 = load i32, ptr @sq, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr @sq, align 4, !tbaa !5
  %32 = sdiv i32 %29, %31
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @blk, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %56, %27
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr @perm, i64 %41
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr @blk, align 4, !tbaa !5
  %46 = sub nsw i32 %44, %45
  store i32 %46, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  %47 = 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) %4)
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %56

56:                                               ; preds = %39
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !11

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

60:                                               ; preds = %80, %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = load i32, ptr @m, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %83

65:                                               ; preds = %60
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.Query, ptr %69, i32 0, i32 0
  store i32 %66, ptr %70, align 4, !tbaa !12
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Query, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.Query, ptr %77, i32 0, i32 2
  %79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %74, ptr noundef %78)
  br label %80

80:                                               ; preds = %65
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !5
  br label %60, !llvm.loop !14

83:                                               ; preds = %64
  %84 = load i32, ptr @m, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds %struct.Query, ptr @que, i64 %85
  %87 = getelementptr inbounds %struct.Query, ptr %86, i64 1
  call void @_ZSt4sortIP5QueryEvT_S2_(ptr noundef getelementptr inbounds (%struct.Query, ptr @que, i64 1), ptr noundef %87)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %251, %83
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr @m, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

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

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %95
  %97 = getelementptr inbounds %struct.Query, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !15
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  store i32 %101, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %103
  %105 = getelementptr inbounds %struct.Query, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !15
  store i32 %106, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %107 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %107, ptr %10, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %122, %93
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %112, label %119

112:                                              ; preds = %108
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = icmp eq i32 %116, %117
  br label %119

119:                                              ; preds = %112, %108
  %120 = phi i1 [ false, %108 ], [ %118, %112 ]
  br i1 %120, label %121, label %127

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %9, align 4, !tbaa !5
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %10, align 4, !tbaa !5
  br label %108, !llvm.loop !16

127:                                              ; preds = %119
  br label %128

128:                                              ; preds = %177, %127
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = load i32, ptr @m, align 4, !tbaa !5
  %131 = icmp sle i32 %129, %130
  br i1 %131, label %132, label %143

132:                                              ; preds = %128
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %134
  %136 = getelementptr inbounds %struct.Query, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 4, !tbaa !17
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = icmp eq i32 %140, %141
  br label %143

143:                                              ; preds = %132, %128
  %144 = phi i1 [ false, %128 ], [ %142, %132 ]
  br i1 %144, label %145, label %180

145:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %147
  %149 = getelementptr inbounds %struct.Query, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !15
  store i32 %150, ptr %11, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %165, %145
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.Query, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !17
  %158 = icmp sle i32 %152, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %151
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %168

160:                                              ; preds = %151
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [50003 x i32], ptr @perm, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %164)
  br label %165

165:                                              ; preds = %160
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %11, align 4, !tbaa !5
  br label %151, !llvm.loop !18

168:                                              ; preds = %159
  %169 = load i32, ptr @mx, align 4, !tbaa !5
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.Query, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 4, !tbaa !12
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [50003 x i32], ptr @ans, i64 0, i64 %175
  store i32 %169, ptr %176, align 4, !tbaa !5
  call void @_Z8rollbackii(i32 noundef 0, i32 noundef 0)
  br label %177

177:                                              ; preds = %168
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %6, align 4, !tbaa !5
  br label %128, !llvm.loop !19

180:                                              ; preds = %143
  br label %181

181:                                              ; preds = %248, %180
  %182 = load i32, ptr %6, align 4, !tbaa !5
  %183 = load i32, ptr @m, align 4, !tbaa !5
  %184 = icmp sle i32 %182, %183
  br i1 %184, label %185, label %196

185:                                              ; preds = %181
  %186 = load i32, ptr %6, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %187
  %189 = getelementptr inbounds %struct.Query, ptr %188, i32 0, i32 1
  %190 = load i32, ptr %189, align 4, !tbaa !15
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = load i32, ptr %8, align 4, !tbaa !5
  %195 = icmp eq i32 %193, %194
  br label %196

196:                                              ; preds = %185, %181
  %197 = phi i1 [ false, %181 ], [ %195, %185 ]
  br i1 %197, label %198, label %251

198:                                              ; preds = %196
  br label %199

199:                                              ; preds = %212, %198
  %200 = load i32, ptr %10, align 4, !tbaa !5
  %201 = load i32, ptr %6, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %202
  %204 = getelementptr inbounds %struct.Query, ptr %203, i32 0, i32 2
  %205 = load i32, ptr %204, align 4, !tbaa !17
  %206 = icmp sle i32 %200, %205
  br i1 %206, label %207, label %215

207:                                              ; preds = %199
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [50003 x i32], ptr @perm, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %211)
  br label %212

212:                                              ; preds = %207
  %213 = load i32, ptr %10, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %10, align 4, !tbaa !5
  br label %199, !llvm.loop !20

215:                                              ; preds = %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %216 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %216, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %217 = load i32, ptr @mx, align 4, !tbaa !5
  store i32 %217, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %218 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %218, ptr %14, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %233, %215
  %220 = load i32, ptr %9, align 4, !tbaa !5
  %221 = load i32, ptr %6, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %222
  %224 = getelementptr inbounds %struct.Query, ptr %223, i32 0, i32 1
  %225 = load i32, ptr %224, align 4, !tbaa !15
  %226 = icmp sgt i32 %220, %225
  br i1 %226, label %227, label %236

227:                                              ; preds = %219
  %228 = load i32, ptr %9, align 4, !tbaa !5
  %229 = sub nsw i32 %228, 1
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [50003 x i32], ptr @perm, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %232)
  br label %233

233:                                              ; preds = %227
  %234 = load i32, ptr %9, align 4, !tbaa !5
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr %9, align 4, !tbaa !5
  br label %219, !llvm.loop !21

236:                                              ; preds = %219
  %237 = load i32, ptr @mx, align 4, !tbaa !5
  %238 = load i32, ptr %6, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %239
  %241 = getelementptr inbounds %struct.Query, ptr %240, i32 0, i32 0
  %242 = load i32, ptr %241, align 4, !tbaa !12
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [50003 x i32], ptr @ans, i64 0, i64 %243
  store i32 %237, ptr %244, align 4, !tbaa !5
  %245 = load i32, ptr %12, align 4, !tbaa !5
  %246 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z8rollbackii(i32 noundef %245, i32 noundef %246)
  %247 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %247, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %248

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

251:                                              ; preds = %196
  call void @_Z8rollbackii(i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %88, !llvm.loop !23

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

253:                                              ; preds = %264, %252
  %254 = load i32, ptr %15, align 4, !tbaa !5
  %255 = load i32, ptr @m, align 4, !tbaa !5
  %256 = icmp sle i32 %254, %255
  br i1 %256, label %258, label %257

257:                                              ; preds = %253
  store i32 31, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %267

258:                                              ; preds = %253
  %259 = load i32, ptr %15, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [50003 x i32], ptr @ans, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %262)
  br label %264

264:                                              ; preds = %258
  %265 = load i32, ptr %15, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %15, align 4, !tbaa !5
  br label %253, !llvm.loop !24

267:                                              ; preds = %257
  ret i32 0
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z6inserti(i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z8rollbackii(i32 noundef, i32 noundef) #3

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8}
!14 = distinct !{!14, !10}
!15 = !{!13, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = !{!13, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !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.Query = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sq = external dso_local local_unnamed_addr global i32, align 4
@blk = external dso_local local_unnamed_addr global i32, align 4
@perm = external dso_local global [50003 x i32], align 16
@pos = external dso_local local_unnamed_addr global [50003 x i32], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global [50003 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [50003 x %struct.Query], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %sq.promoted = load i32, ptr @sq, align 4, !tbaa !5
  %5 = mul nsw i32 %sq.promoted, %sq.promoted
  %.not79 = icmp sgt i32 %5, %4
  br i1 %.not79, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %6 = phi i32 [ %7, %.lr.ph ], [ %sq.promoted, %0 ]
  %7 = add nsw i32 %6, 1
  %8 = mul nsw i32 %7, %7
  %.not = icmp sgt i32 %8, %4
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa78 = phi i32 [ %sq.promoted, %0 ], [ %7, %.lr.ph ]
  %9 = add nsw i32 %4, -1
  %10 = add nsw i32 %.lcssa78, -1
  store i32 %10, ptr @sq, align 4, !tbaa !5
  %11 = sdiv i32 %9, %10
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr @blk, align 4, !tbaa !5
  %.not6682 = icmp slt i32 %4, 1
  br i1 %.not6682, label %.preheader76, label %.lr.ph85

.preheader76:                                     ; preds = %.lr.ph85, %._crit_edge
  %13 = load i32, ptr @m, align 4, !tbaa !5
  %.not6786 = icmp slt i32 %13, 1
  br i1 %.not6786, label %.preheader76.._crit_edge89_crit_edge, label %.lr.ph88

.preheader76.._crit_edge89_crit_edge:             ; preds = %.preheader76
  %.pre171 = sext i32 %13 to i64
  br label %._crit_edge89

.lr.ph85:                                         ; preds = %._crit_edge, %.lr.ph85
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph85 ], [ 1, %._crit_edge ]
  %14 = getelementptr inbounds i32, ptr @perm, i64 %indvars.iv
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %16 = load i32, ptr @blk, align 4, !tbaa !5
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  %18 = sub nsw i32 %17, %16
  store i32 %18, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  %25 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %indvars.iv
  store i32 %24, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %.not66.not = icmp slt i64 %indvars.iv, %27
  br i1 %.not66.not, label %.lr.ph85, label %.preheader76, !llvm.loop !11

._crit_edge89:                                    ; preds = %.lr.ph88, %.preheader76.._crit_edge89_crit_edge
  %.pre-phi = phi i64 [ %.pre171, %.preheader76.._crit_edge89_crit_edge ], [ %37, %.lr.ph88 ]
  %28 = getelementptr inbounds %struct.Query, ptr @que, i64 %.pre-phi
  %29 = getelementptr inbounds i8, ptr %28, i64 12
  call void @_ZSt4sortIP5QueryEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @que, i64 12), ptr noundef nonnull %29)
  %30 = load i32, ptr @m, align 4, !tbaa !5
  %.not68128 = icmp slt i32 %30, 1
  br i1 %.not68128, label %._crit_edge135, label %.lr.ph131

.lr.ph88:                                         ; preds = %.preheader76, %.lr.ph88
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph88 ], [ 1, %.preheader76 ]
  %31 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %indvars.iv140
  %32 = trunc nuw nsw i64 %indvars.iv140 to i32
  store i32 %32, ptr %31, align 4, !tbaa !12
  %33 = getelementptr inbounds i8, ptr %31, i64 4
  %34 = getelementptr inbounds i8, ptr %31, i64 8
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %33, ptr noundef nonnull %34)
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %.not67.not = icmp slt i64 %indvars.iv140, %37
  br i1 %.not67.not, label %.lr.ph88, label %._crit_edge89, !llvm.loop !14

.preheader:                                       ; preds = %.critedge4
  %38 = icmp slt i32 %115, 1
  br i1 %38, label %._crit_edge135, label %.lr.ph134

.lr.ph131:                                        ; preds = %._crit_edge89, %.critedge4
  %39 = phi i32 [ %115, %.critedge4 ], [ %30, %._crit_edge89 ]
  %.056129 = phi i32 [ %.2.lcssa, %.critedge4 ], [ 1, %._crit_edge89 ]
  %40 = sext i32 %.056129 to i64
  %41 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %40, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %.not7091 = icmp sgt i32 %42, %39
  br i1 %.not7091, label %.critedge, label %.lr.ph95.preheader

.lr.ph95.preheader:                               ; preds = %.lr.ph131
  %46 = add i32 %39, 1
  br label %.lr.ph95

.lr.ph95:                                         ; preds = %.lr.ph95.preheader, %50
  %indvars.iv143 = phi i64 [ %43, %.lr.ph95.preheader ], [ %indvars.iv.next144, %50 ]
  %47 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %indvars.iv143
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp eq i32 %48, %45
  br i1 %49, label %50, label %.critedge.loopexit.split.loop.exit175

50:                                               ; preds = %.lr.ph95
  %indvars.iv.next144 = add nsw i64 %indvars.iv143, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next144 to i32
  %exitcond.not = icmp eq i32 %46, %lftr.wideiv
  br i1 %exitcond.not, label %.critedge, label %.lr.ph95, !llvm.loop !16

.critedge.loopexit.split.loop.exit175:            ; preds = %.lr.ph95
  %indvars145.le = trunc i64 %indvars.iv143 to i32
  br label %.critedge

.critedge:                                        ; preds = %50, %.critedge.loopexit.split.loop.exit175, %.lr.ph131
  %.061.lcssa = phi i32 [ %42, %.lr.ph131 ], [ %indvars145.le, %.critedge.loopexit.split.loop.exit175 ], [ %46, %50 ]
  %.not71106 = icmp sgt i32 %.056129, %39
  br i1 %.not71106, label %.critedge2, label %.lr.ph108.preheader

.lr.ph108.preheader:                              ; preds = %.critedge
  %51 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %40
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i32, ptr %52, align 4, !tbaa !17
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %56, %45
  br i1 %57, label %.lr.ph181, label %.critedge2.loopexit

.lr.ph108:                                        ; preds = %._crit_edge105
  %58 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %indvars.iv.next152
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load i32, ptr %59, align 4, !tbaa !17
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp eq i32 %63, %45
  br i1 %64, label %.lr.ph181, label %.critedge2.loopexit, !llvm.loop !18

.lr.ph181:                                        ; preds = %.lr.ph108.preheader, %.lr.ph108
  %65 = phi i32 [ %60, %.lr.ph108 ], [ %53, %.lr.ph108.preheader ]
  %66 = phi ptr [ %59, %.lr.ph108 ], [ %52, %.lr.ph108.preheader ]
  %67 = phi ptr [ %58, %.lr.ph108 ], [ %51, %.lr.ph108.preheader ]
  %indvars.iv151180 = phi i64 [ %indvars.iv.next152, %.lr.ph108 ], [ %40, %.lr.ph108.preheader ]
  %68 = getelementptr inbounds i8, ptr %67, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %.not74101 = icmp sgt i32 %69, %65
  br i1 %.not74101, label %._crit_edge105, label %.lr.ph104.preheader

.lr.ph104.preheader:                              ; preds = %.lr.ph181
  %70 = sext i32 %69 to i64
  br label %.lr.ph104

._crit_edge105:                                   ; preds = %.lr.ph104, %.lr.ph181
  %71 = load i32, ptr @mx, align 4, !tbaa !5
  %72 = load i32, ptr %67, align 4, !tbaa !12
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [50003 x i32], ptr @ans, i64 0, i64 %73
  store i32 %71, ptr %74, align 4, !tbaa !5
  call void @_Z8rollbackii(i32 noundef 0, i32 noundef 0)
  %indvars.iv.next152 = add nsw i64 %indvars.iv151180, 1
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %.not71.not = icmp slt i64 %indvars.iv151180, %76
  br i1 %.not71.not, label %.lr.ph108, label %.critedge2.loopexit, !llvm.loop !18

.lr.ph104:                                        ; preds = %.lr.ph104.preheader, %.lr.ph104
  %indvars.iv148 = phi i64 [ %70, %.lr.ph104.preheader ], [ %indvars.iv.next149, %.lr.ph104 ]
  %77 = getelementptr inbounds [50003 x i32], ptr @perm, i64 0, i64 %indvars.iv148
  %78 = load i32, ptr %77, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %78)
  %indvars.iv.next149 = add nsw i64 %indvars.iv148, 1
  %79 = load i32, ptr %66, align 4, !tbaa !17
  %80 = sext i32 %79 to i64
  %.not74.not = icmp slt i64 %indvars.iv148, %80
  br i1 %.not74.not, label %.lr.ph104, label %._crit_edge105, !llvm.loop !19

.critedge2.loopexit:                              ; preds = %.lr.ph108, %._crit_edge105, %.lr.ph108.preheader
  %81 = phi i32 [ %39, %.lr.ph108.preheader ], [ %75, %._crit_edge105 ], [ %75, %.lr.ph108 ]
  %.1.lcssa.ph.in = phi i64 [ %40, %.lr.ph108.preheader ], [ %indvars.iv.next152, %._crit_edge105 ], [ %indvars.iv.next152, %.lr.ph108 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.critedge
  %82 = phi i32 [ %39, %.critedge ], [ %81, %.critedge2.loopexit ]
  %.1.lcssa = phi i32 [ %.056129, %.critedge ], [ %.1.lcssa.ph, %.critedge2.loopexit ]
  %.not72121 = icmp sgt i32 %.1.lcssa, %82
  br i1 %.not72121, label %.critedge4, label %.lr.ph124.preheader

.lr.ph124.preheader:                              ; preds = %.critedge2
  %83 = sext i32 %.061.lcssa to i64
  %84 = sext i32 %.1.lcssa to i64
  br label %.lr.ph124

.lr.ph124:                                        ; preds = %.lr.ph124.preheader, %._crit_edge120
  %indvars.iv162 = phi i64 [ %84, %.lr.ph124.preheader ], [ %indvars.iv.next163, %._crit_edge120 ]
  %.159122 = phi i32 [ %.061.lcssa, %.lr.ph124.preheader ], [ %.260.lcssa, %._crit_edge120 ]
  %85 = getelementptr inbounds [50003 x %struct.Query], ptr @que, i64 0, i64 %indvars.iv162
  %86 = getelementptr inbounds i8, ptr %85, i64 4
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [50003 x i32], ptr @pos, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp eq i32 %90, %45
  br i1 %91, label %.preheader75, label %.critedge4.loopexit

.preheader75:                                     ; preds = %.lr.ph124
  %92 = getelementptr inbounds i8, ptr %85, i64 8
  %93 = load i32, ptr %92, align 4, !tbaa !17
  %.not73112 = icmp sgt i32 %.159122, %93
  br i1 %.not73112, label %._crit_edge115, label %.lr.ph114.preheader

.lr.ph114.preheader:                              ; preds = %.preheader75
  %94 = sext i32 %.159122 to i64
  br label %.lr.ph114

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %.lr.ph114
  %indvars.iv154 = phi i64 [ %94, %.lr.ph114.preheader ], [ %indvars.iv.next155, %.lr.ph114 ]
  %95 = getelementptr inbounds [50003 x i32], ptr @perm, i64 0, i64 %indvars.iv154
  %96 = load i32, ptr %95, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %96)
  %indvars.iv.next155 = add nsw i64 %indvars.iv154, 1
  %97 = load i32, ptr %92, align 4, !tbaa !17
  %98 = sext i32 %97 to i64
  %.not73.not = icmp slt i64 %indvars.iv154, %98
  br i1 %.not73.not, label %.lr.ph114, label %._crit_edge115.loopexit, !llvm.loop !20

._crit_edge115.loopexit:                          ; preds = %.lr.ph114
  %99 = trunc nsw i64 %indvars.iv.next155 to i32
  %.pre = load i32, ptr %86, align 4, !tbaa !15
  br label %._crit_edge115

._crit_edge115:                                   ; preds = %._crit_edge115.loopexit, %.preheader75
  %100 = phi i32 [ %87, %.preheader75 ], [ %.pre, %._crit_edge115.loopexit ]
  %.260.lcssa = phi i32 [ %.159122, %.preheader75 ], [ %99, %._crit_edge115.loopexit ]
  %101 = load i32, ptr @tot, align 4, !tbaa !5
  %102 = load i32, ptr @mx, align 4, !tbaa !5
  %103 = icmp sgt i32 %.061.lcssa, %100
  br i1 %103, label %.lr.ph119, label %._crit_edge120

.lr.ph119:                                        ; preds = %._crit_edge115, %.lr.ph119
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %.lr.ph119 ], [ %83, %._crit_edge115 ]
  %indvars.iv.next159 = add nsw i64 %indvars.iv158, -1
  %104 = getelementptr inbounds [50003 x i32], ptr @perm, i64 0, i64 %indvars.iv.next159
  %105 = load i32, ptr %104, align 4, !tbaa !5
  call void @_Z6inserti(i32 noundef %105)
  %106 = load i32, ptr %86, align 4, !tbaa !15
  %107 = sext i32 %106 to i64
  %108 = icmp sgt i64 %indvars.iv.next159, %107
  br i1 %108, label %.lr.ph119, label %._crit_edge120.loopexit, !llvm.loop !21

._crit_edge120.loopexit:                          ; preds = %.lr.ph119
  %.pre170 = load i32, ptr @mx, align 4, !tbaa !5
  br label %._crit_edge120

._crit_edge120:                                   ; preds = %._crit_edge120.loopexit, %._crit_edge115
  %109 = phi i32 [ %.pre170, %._crit_edge120.loopexit ], [ %102, %._crit_edge115 ]
  %110 = load i32, ptr %85, align 4, !tbaa !12
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [50003 x i32], ptr @ans, i64 0, i64 %111
  store i32 %109, ptr %112, align 4, !tbaa !5
  call void @_Z8rollbackii(i32 noundef %101, i32 noundef %102)
  %indvars.iv.next163 = add nsw i64 %indvars.iv162, 1
  %113 = load i32, ptr @m, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %.not72.not = icmp slt i64 %indvars.iv162, %114
  br i1 %.not72.not, label %.lr.ph124, label %.critedge4.loopexit, !llvm.loop !22

.critedge4.loopexit:                              ; preds = %._crit_edge120, %.lr.ph124
  %.2.lcssa.ph.in = phi i64 [ %indvars.iv162, %.lr.ph124 ], [ %indvars.iv.next163, %._crit_edge120 ]
  %.2.lcssa.ph = trunc i64 %.2.lcssa.ph.in to i32
  br label %.critedge4

.critedge4:                                       ; preds = %.critedge4.loopexit, %.critedge2
  %.2.lcssa = phi i32 [ %.1.lcssa, %.critedge2 ], [ %.2.lcssa.ph, %.critedge4.loopexit ]
  call void @_Z8rollbackii(i32 noundef 0, i32 noundef 0)
  %115 = load i32, ptr @m, align 4, !tbaa !5
  %.not68 = icmp sgt i32 %.2.lcssa, %115
  br i1 %.not68, label %.preheader, label %.lr.ph131, !llvm.loop !23

._crit_edge135:                                   ; preds = %.lr.ph134, %._crit_edge89, %.preheader
  ret i32 0

.lr.ph134:                                        ; preds = %.preheader, %.lr.ph134
  %indvars.iv166 = phi i64 [ %indvars.iv.next167, %.lr.ph134 ], [ 1, %.preheader ]
  %116 = getelementptr inbounds [50003 x i32], ptr @ans, i64 0, i64 %indvars.iv166
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %117)
  %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
  %119 = load i32, ptr @m, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %.not69.not = icmp slt i64 %indvars.iv166, %120
  br i1 %.not69.not, label %.lr.ph134, label %._crit_edge135, !llvm.loop !24
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z6inserti(i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z8rollbackii(i32 noundef, i32 noundef) 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8}
!14 = distinct !{!14, !10}
!15 = !{!13, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = !{!13, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass