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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@pos = external dso_local global [251 x i32], align 16
@g = external dso_local global [251 x [251 x i32]], align 16
@f = external dso_local global [251 x [251 x i32]], align 16
@a = external dso_local global [251 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %32, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.Node, ptr %25, i32 0, i32 0
  store i32 %22, ptr %26, align 8, !tbaa !9
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %28
  %30 = getelementptr inbounds %struct.Node, ptr %29, i32 0, i32 1
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %30)
  br label %32

32:                                               ; preds = %21
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !11

35:                                               ; preds = %20
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct.Node, ptr @a, i64 %37
  %39 = getelementptr inbounds %struct.Node, ptr %38, i64 1
  call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef getelementptr inbounds (%struct.Node, ptr @a, i64 1), ptr noundef %39)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %54, %35
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %40
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %48
  %50 = getelementptr inbounds %struct.Node, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %52
  store i32 %46, ptr %53, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %45
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %40, !llvm.loop !13

57:                                               ; preds = %44
  call void @llvm.memset.p0.i64(ptr align 16 @g, i8 63, i64 252004, i1 false)
  br label %58

58:                                               ; preds = %93, %57
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr @m, align 4, !tbaa !5
  %61 = icmp ne i32 %59, 0
  br i1 %61, label %62, label %94

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  store i32 %68, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [251 x i32], ptr %70, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp slt i32 %64, %77
  br i1 %78, label %79, label %93

79:                                               ; preds = %62
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %82
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [251 x i32], ptr %83, i64 0, i64 %85
  store i32 %80, ptr %86, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [251 x i32], ptr %89, i64 0, i64 %91
  store i32 %80, ptr %92, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %79, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %58, !llvm.loop !14

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

95:                                               ; preds = %107, %94
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp sle i32 %96, %97
  br i1 %98, label %100, label %99

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

100:                                              ; preds = %95
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %102
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [251 x i32], ptr %103, i64 0, i64 %105
  store i32 0, ptr %106, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %100
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %7, align 4, !tbaa !5
  br label %95, !llvm.loop !15

110:                                              ; preds = %99
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 252004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %111

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

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

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

117:                                              ; preds = %228, %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = icmp sle i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %231

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

123:                                              ; preds = %224, %122
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp sle i32 %124, %125
  br i1 %126, label %128, label %127

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

128:                                              ; preds = %123
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %130
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [251 x i32], ptr %131, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %137
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [251 x i32], ptr %138, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %144
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [251 x i32], ptr %145, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %142, %149
  %151 = icmp sge i32 %135, %150
  br i1 %151, label %152, label %223

152:                                              ; preds = %128
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %154
  %156 = load i32, ptr %8, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [251 x i32], ptr %155, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %161
  %163 = load i32, ptr %11, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [251 x i32], ptr %162, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = add nsw i32 %159, %166
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %169
  %171 = load i32, ptr %11, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [251 x i32], ptr %170, i64 0, i64 %172
  store i32 %167, ptr %173, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %174 = load i32, ptr %10, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %175
  %177 = getelementptr inbounds %struct.Node, ptr %176, i32 0, i32 1
  %178 = load i32, ptr %11, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %179
  %181 = getelementptr inbounds %struct.Node, ptr %180, i32 0, i32 1
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %183
  %185 = getelementptr inbounds %struct.Node, ptr %184, i32 0, i32 1
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %181, ptr noundef nonnull align 4 dereferenceable(4) %185)
  %187 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %177, ptr noundef nonnull align 4 dereferenceable(4) %186)
  %188 = load i32, ptr %187, align 4, !tbaa !5
  store i32 %188, ptr %12, align 4, !tbaa !5
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [251 x [251 x i32]], ptr @f, i64 0, i64 %190
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [251 x i32], ptr %191, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = load i32, ptr %10, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %197
  %199 = load i32, ptr %11, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [251 x i32], ptr %198, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = load i32, ptr %12, align 4, !tbaa !5
  %204 = add nsw i32 %202, %203
  %205 = icmp sgt i32 %195, %204
  br i1 %205, label %206, label %222

206:                                              ; preds = %152
  %207 = load i32, ptr %10, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %208
  %210 = load i32, ptr %11, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [251 x i32], ptr %209, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = add nsw i32 %213, %214
  %216 = load i32, ptr %10, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [251 x [251 x i32]], ptr @f, i64 0, i64 %217
  %219 = load i32, ptr %11, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [251 x i32], ptr %218, i64 0, i64 %220
  store i32 %215, ptr %221, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %206, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %223

223:                                              ; preds = %222, %128
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %11, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %11, align 4, !tbaa !5
  br label %123, !llvm.loop !16

227:                                              ; preds = %127
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %10, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %10, align 4, !tbaa !5
  br label %117, !llvm.loop !17

231:                                              ; preds = %121
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %8, align 4, !tbaa !5
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %8, align 4, !tbaa !5
  br label %111, !llvm.loop !18

235:                                              ; preds = %115
  br label %236

236:                                              ; preds = %240, %235
  %237 = load i32, ptr @q, align 4, !tbaa !5
  %238 = add nsw i32 %237, -1
  store i32 %238, ptr @q, align 4, !tbaa !5
  %239 = icmp ne i32 %237, 0
  br i1 %239, label %240, label %256

240:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %241 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %13, ptr noundef %14)
  %242 = load i32, ptr %13, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [251 x [251 x i32]], ptr @f, i64 0, i64 %246
  %248 = load i32, ptr %14, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [251 x i32], ptr %247, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %254)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %236, !llvm.loop !19

256:                                              ; preds = %236
  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: 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 @_ZSt4sortIP4NodeEvT_S2_(ptr noundef, ptr noundef) #3

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

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

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

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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@pos = external dso_local local_unnamed_addr global [251 x i32], align 16
@g = external dso_local local_unnamed_addr global [251 x [251 x i32]], align 16
@f = external dso_local local_unnamed_addr global [251 x [251 x i32]], align 16
@a = external dso_local global [251 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @q)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not63 = icmp slt i32 %7, 1
  br i1 %.not63, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre110 = sext i32 %7 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre110, %.._crit_edge_crit_edge ], [ %18, %.lr.ph ]
  %8 = getelementptr inbounds %struct.Node, ptr @a, i64 %.pre-phi
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  tail call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 8), ptr noundef nonnull %9)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not5265 = icmp slt i32 %10, 1
  br i1 %.not5265, label %._crit_edge69, label %.lr.ph68.preheader

.lr.ph68.preheader:                               ; preds = %._crit_edge
  %11 = zext nneg i32 %10 to i64
  %xtraiter = and i64 %11, 3
  %12 = icmp ult i32 %10, 4
  br i1 %12, label %._crit_edge69.loopexit.unr-lcssa, label %.lr.ph68.preheader.new

.lr.ph68.preheader.new:                           ; preds = %.lr.ph68.preheader
  %unroll_iter = and i64 %11, 2147483644
  br label %.lr.ph68

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

._crit_edge69.loopexit.unr-lcssa:                 ; preds = %.lr.ph68, %.lr.ph68.preheader
  %indvars.iv93.unr = phi i64 [ 1, %.lr.ph68.preheader ], [ %indvars.iv.next94.3, %.lr.ph68 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge69, label %.lr.ph68.epil

.lr.ph68.epil:                                    ; preds = %._crit_edge69.loopexit.unr-lcssa, %.lr.ph68.epil
  %indvars.iv93.epil = phi i64 [ %indvars.iv.next94.epil, %.lr.ph68.epil ], [ %indvars.iv93.unr, %._crit_edge69.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph68.epil ], [ 0, %._crit_edge69.loopexit.unr-lcssa ]
  %19 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv93.epil
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %21
  %23 = trunc nuw nsw i64 %indvars.iv93.epil to i32
  store i32 %23, ptr %22, align 4, !tbaa !5
  %indvars.iv.next94.epil = add nuw nsw i64 %indvars.iv93.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge69, label %.lr.ph68.epil, !llvm.loop !13

._crit_edge69:                                    ; preds = %._crit_edge69.loopexit.unr-lcssa, %.lr.ph68.epil, %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(252004) @g, i8 63, i64 252004, i1 false)
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr @m, align 4, !tbaa !5
  %.not5370 = icmp eq i32 %24, 0
  br i1 %.not5370, label %.preheader62, label %.lr.ph72

.lr.ph68:                                         ; preds = %.lr.ph68, %.lr.ph68.preheader.new
  %indvars.iv93 = phi i64 [ 1, %.lr.ph68.preheader.new ], [ %indvars.iv.next94.3, %.lr.ph68 ]
  %niter = phi i64 [ 0, %.lr.ph68.preheader.new ], [ %niter.next.3, %.lr.ph68 ]
  %26 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv93
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %28
  %30 = trunc nuw nsw i64 %indvars.iv93 to i32
  store i32 %30, ptr %29, align 4, !tbaa !5
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %31 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv.next94
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %33
  %35 = trunc nuw nsw i64 %indvars.iv.next94 to i32
  store i32 %35, ptr %34, align 4, !tbaa !5
  %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 2
  %36 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv.next94.1
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %38
  %40 = trunc nuw nsw i64 %indvars.iv.next94.1 to i32
  store i32 %40, ptr %39, align 4, !tbaa !5
  %indvars.iv.next94.2 = add nuw nsw i64 %indvars.iv93, 3
  %41 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv.next94.2
  %42 = load i32, ptr %41, align 8, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %43
  %45 = trunc nuw nsw i64 %indvars.iv.next94.2 to i32
  store i32 %45, ptr %44, align 4, !tbaa !5
  %indvars.iv.next94.3 = add nuw nsw i64 %indvars.iv93, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge69.loopexit.unr-lcssa, label %.lr.ph68, !llvm.loop !15

.preheader62.loopexit:                            ; preds = %66
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader62

.preheader62:                                     ; preds = %.preheader62.loopexit, %._crit_edge69
  %46 = phi i32 [ %.pre, %.preheader62.loopexit ], [ %10, %._crit_edge69 ]
  %.not5473 = icmp slt i32 %46, 1
  br i1 %.not5473, label %._crit_edge76.thread, label %.lr.ph75.preheader

._crit_edge76.thread:                             ; preds = %.preheader62
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(252004) @f, i8 63, i64 252004, i1 false)
  br label %.preheader

.lr.ph75.preheader:                               ; preds = %.preheader62
  %47 = zext nneg i32 %46 to i64
  %xtraiter122 = and i64 %47, 3
  %48 = icmp ult i32 %46, 4
  br i1 %48, label %._crit_edge76.unr-lcssa, label %.lr.ph75.preheader.new

.lr.ph75.preheader.new:                           ; preds = %.lr.ph75.preheader
  %unroll_iter125 = and i64 %47, 2147483644
  br label %.lr.ph75

.lr.ph72:                                         ; preds = %._crit_edge69, %66
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %55, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp slt i32 %50, %62
  br i1 %63, label %64, label %66

64:                                               ; preds = %.lr.ph72
  %65 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %60, i64 %55
  store i32 %50, ptr %65, align 4, !tbaa !5
  store i32 %50, ptr %61, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %64, %.lr.ph72
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr @m, align 4, !tbaa !5
  %.not53 = icmp eq i32 %67, 0
  br i1 %.not53, label %.preheader62.loopexit, label %.lr.ph72, !llvm.loop !16

._crit_edge76.unr-lcssa:                          ; preds = %.lr.ph75, %.lr.ph75.preheader
  %indvars.iv96.unr = phi i64 [ 1, %.lr.ph75.preheader ], [ %indvars.iv.next97.3, %.lr.ph75 ]
  %lcmp.mod124.not = icmp eq i64 %xtraiter122, 0
  br i1 %lcmp.mod124.not, label %._crit_edge76, label %.lr.ph75.epil

.lr.ph75.epil:                                    ; preds = %._crit_edge76.unr-lcssa, %.lr.ph75.epil
  %indvars.iv96.epil = phi i64 [ %indvars.iv.next97.epil, %.lr.ph75.epil ], [ %indvars.iv96.unr, %._crit_edge76.unr-lcssa ]
  %epil.iter123 = phi i64 [ %epil.iter123.next, %.lr.ph75.epil ], [ 0, %._crit_edge76.unr-lcssa ]
  %69 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv96.epil, i64 %indvars.iv96.epil
  store i32 0, ptr %69, align 4, !tbaa !5
  %indvars.iv.next97.epil = add nuw nsw i64 %indvars.iv96.epil, 1
  %epil.iter123.next = add i64 %epil.iter123, 1
  %epil.iter123.cmp.not = icmp eq i64 %epil.iter123.next, %xtraiter122
  br i1 %epil.iter123.cmp.not, label %._crit_edge76, label %.lr.ph75.epil, !llvm.loop !17

._crit_edge76:                                    ; preds = %.lr.ph75.epil, %._crit_edge76.unr-lcssa
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(252004) @f, i8 63, i64 252004, i1 false)
  br i1 %.not5473, label %.preheader, label %.preheader61

.lr.ph75:                                         ; preds = %.lr.ph75, %.lr.ph75.preheader.new
  %indvars.iv96 = phi i64 [ 1, %.lr.ph75.preheader.new ], [ %indvars.iv.next97.3, %.lr.ph75 ]
  %niter126 = phi i64 [ 0, %.lr.ph75.preheader.new ], [ %niter126.next.3, %.lr.ph75 ]
  %70 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv96, i64 %indvars.iv96
  store i32 0, ptr %70, align 4, !tbaa !5
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %71 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv.next97, i64 %indvars.iv.next97
  store i32 0, ptr %71, align 4, !tbaa !5
  %indvars.iv.next97.1 = add nuw nsw i64 %indvars.iv96, 2
  %72 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv.next97.1, i64 %indvars.iv.next97.1
  store i32 0, ptr %72, align 4, !tbaa !5
  %indvars.iv.next97.2 = add nuw nsw i64 %indvars.iv96, 3
  %73 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv.next97.2, i64 %indvars.iv.next97.2
  store i32 0, ptr %73, align 4, !tbaa !5
  %indvars.iv.next97.3 = add nuw nsw i64 %indvars.iv96, 4
  %niter126.next.3 = add i64 %niter126, 4
  %niter126.ncmp.3 = icmp eq i64 %niter126.next.3, %unroll_iter125
  br i1 %niter126.ncmp.3, label %._crit_edge76.unr-lcssa, label %.lr.ph75, !llvm.loop !18

.preheader61:                                     ; preds = %._crit_edge76, %._crit_edge83
  %74 = phi i32 [ %82, %._crit_edge83 ], [ %46, %._crit_edge76 ]
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %._crit_edge83 ], [ 1, %._crit_edge76 ]
  %.not5781 = icmp slt i32 %74, 1
  br i1 %.not5781, label %._crit_edge83, label %.preheader60.preheader

.preheader60.preheader:                           ; preds = %.preheader61
  %75 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv107, i32 1
  br label %.preheader60

.preheader:                                       ; preds = %._crit_edge83, %._crit_edge76.thread, %._crit_edge76
  %76 = load i32, ptr @q, align 4, !tbaa !5
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr @q, align 4, !tbaa !5
  %.not5686 = icmp eq i32 %76, 0
  br i1 %.not5686, label %._crit_edge88, label %.lr.ph87

.preheader60:                                     ; preds = %.preheader60.preheader, %._crit_edge80
  %78 = phi i32 [ %74, %.preheader60.preheader ], [ %84, %._crit_edge80 ]
  %79 = phi i32 [ %74, %.preheader60.preheader ], [ %85, %._crit_edge80 ]
  %indvars.iv104 = phi i64 [ 1, %.preheader60.preheader ], [ %indvars.iv.next105, %._crit_edge80 ]
  %.not5877 = icmp slt i32 %79, 1
  br i1 %.not5877, label %.preheader60.._crit_edge80_crit_edge, label %.lr.ph79

.preheader60.._crit_edge80_crit_edge:             ; preds = %.preheader60
  %.pre111 = sext i32 %79 to i64
  br label %._crit_edge80

.lr.ph79:                                         ; preds = %.preheader60
  %80 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv104, i64 %indvars.iv107
  %81 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv104, i32 1
  br label %86

._crit_edge83:                                    ; preds = %._crit_edge80, %.preheader61
  %82 = phi i32 [ %74, %.preheader61 ], [ %84, %._crit_edge80 ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %83 = sext i32 %82 to i64
  %.not55.not = icmp slt i64 %indvars.iv107, %83
  br i1 %.not55.not, label %.preheader61, label %.preheader, !llvm.loop !19

._crit_edge80:                                    ; preds = %104, %.preheader60.._crit_edge80_crit_edge
  %.pre-phi112 = phi i64 [ %.pre111, %.preheader60.._crit_edge80_crit_edge ], [ %106, %104 ]
  %84 = phi i32 [ %78, %.preheader60.._crit_edge80_crit_edge ], [ %105, %104 ]
  %85 = phi i32 [ %79, %.preheader60.._crit_edge80_crit_edge ], [ %105, %104 ]
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %.not57.not = icmp slt i64 %indvars.iv104, %.pre-phi112
  br i1 %.not57.not, label %.preheader60, label %._crit_edge83, !llvm.loop !21

86:                                               ; preds = %.lr.ph79, %104
  %indvars.iv101 = phi i64 [ 1, %.lr.ph79 ], [ %indvars.iv.next102, %104 ]
  %87 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv104, i64 %indvars.iv101
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %80, align 4, !tbaa !5
  %90 = getelementptr inbounds [251 x [251 x i32]], ptr @g, i64 0, i64 %indvars.iv107, i64 %indvars.iv101
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, %89
  %.not59 = icmp slt i32 %88, %92
  br i1 %.not59, label %104, label %93

93:                                               ; preds = %86
  store i32 %92, ptr %87, align 4, !tbaa !5
  %94 = getelementptr inbounds [251 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv101, i32 1
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %94, ptr noundef nonnull align 4 dereferenceable(4) %75)
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %95)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = getelementptr inbounds [251 x [251 x i32]], ptr @f, i64 0, i64 %indvars.iv104, i64 %indvars.iv101
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr %87, align 4, !tbaa !5
  %101 = add nsw i32 %100, %97
  %102 = icmp sgt i32 %99, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %93
  store i32 %101, ptr %98, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %93, %103, %86
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %.not58.not = icmp slt i64 %indvars.iv101, %106
  br i1 %.not58.not, label %86, label %._crit_edge80, !llvm.loop !22

.lr.ph87:                                         ; preds = %.preheader, %.lr.ph87
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [251 x i32], ptr @pos, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [251 x [251 x i32]], ptr @f, i64 0, i64 %112, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %119)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %121 = load i32, ptr @q, align 4, !tbaa !5
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr @q, align 4, !tbaa !5
  %.not56 = icmp eq i32 %121, 0
  br i1 %.not56, label %._crit_edge88, label %.lr.ph87, !llvm.loop !23

._crit_edge88:                                    ; preds = %.lr.ph87, %.preheader
  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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; 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 @_ZSt4sortIP4NodeEvT_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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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


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