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

; 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, i32, i32 }

@n = external dso_local global i32, align 4
@f = external dso_local global [100001 x [10 x i32]], align 16
@p = external dso_local global [10 x [100001 x i32]], align 16
@skip = external dso_local global i32, align 4
@num = external dso_local global [10 x i8], align 1
@e = external dso_local global [20 x %struct.Node], align 16
@ans = external dso_local global %struct.Node, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 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 i8, align 1
  %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 %struct.Node, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.Node, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %16

16:                                               ; preds = %288, %0
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %18 = icmp ne i32 %17, -1
  br i1 %18, label %19, label %22

19:                                               ; preds = %16
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp ne i32 %20, 0
  br label %22

22:                                               ; preds = %19, %16
  %23 = phi i1 [ false, %16 ], [ %21, %19 ]
  br i1 %23, label %24, label %295

24:                                               ; preds = %22
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef @num, ptr noundef @.str, i32 noundef %25) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %37, %24
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = load i8, ptr @num, align 1, !tbaa !9
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %32, %34
  br i1 %35, label %36, label %40

36:                                               ; preds = %27
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !10

40:                                               ; preds = %27
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = icmp ne i8 %44, 0
  br i1 %45, label %46, label %74

46:                                               ; preds = %40
  %47 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %47, ptr %3, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %61, %46
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %53, %58
  br i1 %59, label %60, label %64

60:                                               ; preds = %48
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %3, align 4, !tbaa !5
  br label %48, !llvm.loop !12

64:                                               ; preds = %48
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !9
  %69 = icmp ne i8 %68, 0
  br i1 %69, label %73, label %70

70:                                               ; preds = %64
  %71 = load i32, ptr @skip, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr @skip, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %70, %64
  br label %74

74:                                               ; preds = %73, %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %87, %74
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = icmp slt i32 %76, 10
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %90

79:                                               ; preds = %75
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %81
  %83 = getelementptr inbounds [100001 x i32], ptr %82, i64 0, i64 0
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = mul i64 %85, 4
  call void @llvm.memset.p0.i64(ptr align 4 %83, i8 -1, i64 %86, i1 false)
  br label %87

87:                                               ; preds = %79
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %4, align 4, !tbaa !5
  br label %75, !llvm.loop !13

90:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  store i8 0, ptr %5, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %285, %90
  %92 = load i8, ptr %5, align 1, !tbaa !14, !range !16, !noundef !17
  %93 = trunc i8 %92 to i1
  %94 = xor i1 %93, true
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %288

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %253, %96
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 10
  br i1 %99, label %100, label %104

100:                                              ; preds = %97
  %101 = load i8, ptr %5, align 1, !tbaa !14, !range !16, !noundef !17
  %102 = trunc i8 %101 to i1
  %103 = xor i1 %102, true
  br label %104

104:                                              ; preds = %100, %97
  %105 = phi i1 [ false, %97 ], [ %103, %100 ]
  br i1 %105, label %107, label %106

106:                                              ; preds = %104
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %256

107:                                              ; preds = %104
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %110
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [10 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = mul nsw i32 %115, 10
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = add nsw i32 %116, %117
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = srem i32 %118, %119
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %122
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [10 x i32], ptr %123, i64 0, i64 %125
  store i32 %120, ptr %126, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %128
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [10 x i32], ptr %129, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  store i32 %133, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %134 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %134, ptr %11, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %178, %107
  %136 = load i32, ptr %11, align 4, !tbaa !5
  %137 = icmp sge i32 %136, 1
  br i1 %137, label %139, label %138

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

139:                                              ; preds = %135
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %141
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100001 x i32], ptr %142, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = icmp ne i32 %146, -1
  br i1 %147, label %148, label %177

148:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %149 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 0
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %152
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100001 x i32], ptr %153, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = sub nsw i32 %150, %157
  store i32 %158, ptr %149, align 4, !tbaa !18
  %159 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 1
  %160 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %160, ptr %159, align 4, !tbaa !20
  %161 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 2
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %163
  %165 = load i32, ptr %9, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100001 x i32], ptr %164, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  store i32 %168, ptr %161, align 4, !tbaa !21
  %169 = getelementptr inbounds %struct.Node, ptr %12, i32 0, i32 3
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = load i32, ptr %11, align 4, !tbaa !5
  %172 = sub nsw i32 %170, %171
  store i32 %172, ptr %169, align 4, !tbaa !22
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %10, align 4, !tbaa !5
  %175 = sext i32 %173 to i64
  %176 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %176, ptr align 4 %12, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %177

177:                                              ; preds = %148, %139
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %11, align 4, !tbaa !5
  %180 = add nsw i32 %179, -1
  store i32 %180, ptr %11, align 4, !tbaa !5
  br label %135, !llvm.loop !24

181:                                              ; preds = %138
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %188

184:                                              ; preds = %181
  %185 = load i32, ptr @n, align 4, !tbaa !5
  %186 = load i32, ptr %9, align 4, !tbaa !5
  %187 = sub nsw i32 %185, %186
  store i32 %187, ptr %9, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %184, %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %234, %188
  %190 = load i32, ptr %13, align 4, !tbaa !5
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = sub nsw i32 10, %191
  %193 = icmp slt i32 %190, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %189
  store i32 22, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %237

195:                                              ; preds = %189
  %196 = load i32, ptr %13, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %197
  %199 = load i32, ptr %9, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100001 x i32], ptr %198, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = icmp ne i32 %202, -1
  br i1 %203, label %204, label %233

204:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %205 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 0
  %206 = load i32, ptr %6, align 4, !tbaa !5
  %207 = load i32, ptr %13, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %208
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100001 x i32], ptr %209, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = sub nsw i32 %206, %213
  store i32 %214, ptr %205, align 4, !tbaa !18
  %215 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 1
  %216 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %216, ptr %215, align 4, !tbaa !20
  %217 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 2
  %218 = load i32, ptr %13, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %219
  %221 = load i32, ptr %9, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [100001 x i32], ptr %220, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  store i32 %224, ptr %217, align 4, !tbaa !21
  %225 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 3
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = load i32, ptr %13, align 4, !tbaa !5
  %228 = add nsw i32 %226, %227
  store i32 %228, ptr %225, align 4, !tbaa !22
  %229 = load i32, ptr %10, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %10, align 4, !tbaa !5
  %231 = sext i32 %229 to i64
  %232 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %231
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %232, ptr align 4 %14, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  br label %233

233:                                              ; preds = %204, %195
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %13, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %13, align 4, !tbaa !5
  br label %189, !llvm.loop !25

237:                                              ; preds = %194
  %238 = load i32, ptr %10, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds %struct.Node, ptr @e, i64 %239
  call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef @e, ptr noundef %240)
  %241 = load i32, ptr @skip, align 4, !tbaa !5
  %242 = load i32, ptr %10, align 4, !tbaa !5
  %243 = icmp slt i32 %241, %242
  br i1 %243, label %244, label %248

244:                                              ; preds = %237
  %245 = load i32, ptr @skip, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %246
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @ans, ptr align 16 %247, i64 16, i1 false), !tbaa.struct !23
  store i8 1, ptr %5, align 1, !tbaa !14
  br label %252

248:                                              ; preds = %237
  %249 = load i32, ptr %10, align 4, !tbaa !5
  %250 = load i32, ptr @skip, align 4, !tbaa !5
  %251 = sub nsw i32 %250, %249
  store i32 %251, ptr @skip, align 4, !tbaa !5
  br label %252

252:                                              ; preds = %248, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %253

253:                                              ; preds = %252
  %254 = load i32, ptr %8, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %8, align 4, !tbaa !5
  br label %97, !llvm.loop !26

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

257:                                              ; preds = %281, %256
  %258 = load i32, ptr %15, align 4, !tbaa !5
  %259 = icmp slt i32 %258, 10
  br i1 %259, label %260, label %264

260:                                              ; preds = %257
  %261 = load i8, ptr %5, align 1, !tbaa !14, !range !16, !noundef !17
  %262 = trunc i8 %261 to i1
  %263 = xor i1 %262, true
  br label %264

264:                                              ; preds = %260, %257
  %265 = phi i1 [ false, %257 ], [ %263, %260 ]
  br i1 %265, label %267, label %266

266:                                              ; preds = %264
  store i32 25, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %284

267:                                              ; preds = %264
  %268 = load i32, ptr %6, align 4, !tbaa !5
  %269 = load i32, ptr %15, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %270
  %272 = load i32, ptr %6, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %273
  %275 = load i32, ptr %15, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [10 x i32], ptr %274, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [100001 x i32], ptr %271, i64 0, i64 %279
  store i32 %268, ptr %280, align 4, !tbaa !5
  br label %281

281:                                              ; preds = %267
  %282 = load i32, ptr %15, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %15, align 4, !tbaa !5
  br label %257, !llvm.loop !27

284:                                              ; preds = %266
  br label %285

285:                                              ; preds = %284
  %286 = load i32, ptr %6, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %6, align 4, !tbaa !5
  br label %91, !llvm.loop !28

288:                                              ; preds = %95
  %289 = load i32, ptr @n, align 4, !tbaa !5
  %290 = load i32, ptr @ans, align 4, !tbaa !18
  %291 = load i32, ptr getelementptr inbounds (%struct.Node, ptr @ans, i32 0, i32 1), align 4, !tbaa !20
  %292 = load i32, ptr getelementptr inbounds (%struct.Node, ptr @ans, i32 0, i32 2), align 4, !tbaa !21
  %293 = load i32, ptr getelementptr inbounds (%struct.Node, ptr @ans, i32 0, i32 3), align 4, !tbaa !22
  %294 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %289, i32 noundef %290, i32 noundef %291, i32 noundef %292, i32 noundef %293)
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %16, !llvm.loop !29

295:                                              ; preds = %22
  ret i32 0
}

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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

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


; 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, i32, i32 }

@n = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [100001 x [10 x i32]], align 16
@p = external dso_local local_unnamed_addr global [10 x [100001 x i32]], align 16
@skip = external dso_local local_unnamed_addr global i32, align 4
@num = external dso_local global [10 x i8], align 1
@e = external dso_local global [20 x %struct.Node], align 16
@ans = external dso_local local_unnamed_addr global %struct.Node, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 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 @n)
  %2 = icmp ne i32 %1, -1
  %3 = load i32, ptr @n, align 4
  %4 = icmp ne i32 %3, 0
  %5 = select i1 %2, i1 %4, i1 false
  br i1 %5, label %.lr.ph116, label %._crit_edge117

.lr.ph116:                                        ; preds = %0, %._crit_edge111.thread
  %6 = phi i32 [ %193, %._crit_edge111.thread ], [ %3, %0 ]
  %7 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @num, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) #5
  %8 = load i8, ptr @num, align 1, !tbaa !5
  br label %9

9:                                                ; preds = %9, %.lr.ph116
  %indvars.iv = phi i64 [ %indvars.iv.next, %9 ], [ 0, %.lr.ph116 ]
  %10 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %indvars.iv
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = icmp eq i8 %11, %8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %12, label %9, label %13, !llvm.loop !8

13:                                               ; preds = %9
  %.not = icmp eq i8 %11, 0
  br i1 %.not, label %.preheader94.preheader, label %.preheader96

.preheader96:                                     ; preds = %13, %.preheader96
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %.preheader96 ], [ %indvars.iv, %13 ]
  %14 = getelementptr inbounds [10 x i8], ptr @num, i64 0, i64 %indvars.iv121
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = icmp eq i8 %15, %11
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  br i1 %16, label %.preheader96, label %17, !llvm.loop !10

17:                                               ; preds = %.preheader96
  %.not86 = icmp eq i8 %15, 0
  br i1 %.not86, label %18, label %.preheader94.preheader

18:                                               ; preds = %17
  %19 = load i32, ptr @skip, align 4, !tbaa !11
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr @skip, align 4, !tbaa !11
  br label %.preheader94.preheader

.preheader94.preheader:                           ; preds = %17, %18, %13
  %21 = load i32, ptr @n, align 4, !tbaa !11
  %22 = sext i32 %21 to i64
  %23 = shl nsw i64 %22, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @p, i64 400004), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @p, i64 800008), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @p, i64 1200012), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @p, i64 1600016), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @p, i64 2000020), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @p, i64 2400024), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @p, i64 2800028), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @p, i64 3200032), i8 -1, i64 %23, i1 false)
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @p, i64 3600036), i8 -1, i64 %23, i1 false)
  br label %.lr.ph106

.lr.ph106:                                        ; preds = %.preheader94.preheader, %.lr.ph110
  %indvars.iv138 = phi i64 [ 1, %.preheader94.preheader ], [ %indvars.iv.next139, %.lr.ph110 ]
  %24 = add nsw i64 %indvars.iv138, -1
  %25 = trunc nuw nsw i64 %indvars.iv138 to i32
  %26 = trunc nuw nsw i64 %indvars.iv138 to i32
  br label %64

.lr.ph110:                                        ; preds = %196
  %27 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 1
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 1, i64 %29
  %31 = trunc nuw nsw i64 %indvars.iv138 to i32
  store i32 %31, ptr %30, align 4, !tbaa !11
  %32 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 2
  %33 = load i32, ptr %32, align 8, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 2, i64 %34
  store i32 %31, ptr %35, align 4, !tbaa !11
  %36 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 3
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 3, i64 %38
  store i32 %31, ptr %39, align 4, !tbaa !11
  %40 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 4
  %41 = load i32, ptr %40, align 8, !tbaa !11
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 4, i64 %42
  store i32 %31, ptr %43, align 4, !tbaa !11
  %44 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 5
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 5, i64 %46
  store i32 %31, ptr %47, align 4, !tbaa !11
  %48 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 6
  %49 = load i32, ptr %48, align 8, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 6, i64 %50
  store i32 %31, ptr %51, align 4, !tbaa !11
  %52 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 7
  %53 = load i32, ptr %52, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 7, i64 %54
  store i32 %31, ptr %55, align 4, !tbaa !11
  %56 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 8, i64 %58
  store i32 %31, ptr %59, align 4, !tbaa !11
  %60 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 9
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 9, i64 %62
  store i32 %31, ptr %63, align 4, !tbaa !11
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  br label %.lr.ph106, !llvm.loop !13

64:                                               ; preds = %.lr.ph106, %196
  %indvars.iv127 = phi i64 [ 1, %.lr.ph106 ], [ %indvars.iv.next128, %196 ]
  %65 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %24, i64 %indvars.iv127
  %66 = load i32, ptr %65, align 4, !tbaa !11
  %67 = mul nsw i32 %66, 10
  %68 = trunc nuw nsw i64 %indvars.iv127 to i32
  %69 = add nsw i32 %67, %68
  %70 = load i32, ptr @n, align 4
  %71 = srem i32 %69, %70
  %72 = getelementptr inbounds [100001 x [10 x i32]], ptr @f, i64 0, i64 %indvars.iv138, i64 %indvars.iv127
  store i32 %71, ptr %72, align 4, !tbaa !11
  %73 = sext i32 %71 to i64
  br label %80

74:                                               ; preds = %90
  %75 = icmp ult i64 %indvars.iv127, 9
  br i1 %75, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %74
  %.not91 = icmp eq i32 %71, 0
  %76 = sub nsw i32 %70, %71
  %.074 = select i1 %.not91, i32 0, i32 %76
  %77 = sext i32 %.074 to i64
  %78 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 1, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %.not92 = icmp eq i32 %79, -1
  br i1 %.not92, label %103, label %96

80:                                               ; preds = %64, %90
  %indvars.iv129 = phi i64 [ %indvars.iv127, %64 ], [ %indvars.iv.next130, %90 ]
  %.076100 = phi i32 [ 0, %64 ], [ %.177, %90 ]
  %81 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 %indvars.iv129, i64 %73
  %82 = load i32, ptr %81, align 4, !tbaa !11
  %.not93 = icmp eq i32 %82, -1
  br i1 %.not93, label %90, label %83

83:                                               ; preds = %80
  %84 = sub nsw i32 %25, %82
  %85 = sub nuw nsw i64 %indvars.iv127, %indvars.iv129
  %86 = add nsw i32 %.076100, 1
  %87 = sext i32 %.076100 to i64
  %88 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %87
  store i32 %84, ptr %88, align 16, !tbaa !11
  %.sroa.411.0..sroa_idx = getelementptr inbounds i8, ptr %88, i64 4
  store i32 %68, ptr %.sroa.411.0..sroa_idx, align 4, !tbaa !11
  %.sroa.512.0..sroa_idx = getelementptr inbounds i8, ptr %88, i64 8
  store i32 %82, ptr %.sroa.512.0..sroa_idx, align 8, !tbaa !11
  %.sroa.613.0..sroa_idx = getelementptr inbounds i8, ptr %88, i64 12
  %89 = trunc nuw nsw i64 %85 to i32
  store i32 %89, ptr %.sroa.613.0..sroa_idx, align 4, !tbaa !11
  br label %90

90:                                               ; preds = %80, %83
  %.177 = phi i32 [ %86, %83 ], [ %.076100, %80 ]
  %indvars.iv.next130 = add nsw i64 %indvars.iv129, -1
  %91 = icmp sgt i64 %indvars.iv129, 1
  br i1 %91, label %80, label %74, !llvm.loop !14

._crit_edge:                                      ; preds = %173, %176, %103, %114, %126, %137, %149, %160, %172, %74
  %.278.lcssa = phi i32 [ %.177, %74 ], [ %.3, %103 ], [ %.3.1, %114 ], [ %.3.2, %126 ], [ %.3.3, %137 ], [ %.3.4, %149 ], [ %.3.5, %160 ], [ %.3.6, %172 ], [ %178, %176 ], [ %.3.6, %173 ]
  %92 = sext i32 %.278.lcssa to i64
  %93 = getelementptr inbounds %struct.Node, ptr @e, i64 %92
  tail call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef nonnull @e, ptr noundef nonnull %93)
  %94 = load i32, ptr @skip, align 4, !tbaa !11
  %95 = icmp slt i32 %94, %.278.lcssa
  br i1 %95, label %._crit_edge111.thread, label %196

96:                                               ; preds = %.lr.ph
  %97 = sub nsw i32 %26, %79
  %98 = add nsw i32 %.177, 1
  %99 = sext i32 %.177 to i64
  %100 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %99
  store i32 %97, ptr %100, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %100, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %100, i64 8
  store i32 %79, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %100, i64 12
  %101 = trunc nuw i64 %indvars.iv127 to i32
  %102 = add nuw nsw i32 %101, 1
  store i32 %102, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %.lr.ph, %96
  %.3 = phi i32 [ %98, %96 ], [ %.177, %.lr.ph ]
  %.not161 = icmp eq i64 %indvars.iv127, 8
  br i1 %.not161, label %._crit_edge, label %104, !llvm.loop !15

104:                                              ; preds = %103
  %105 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 2, i64 %77
  %106 = load i32, ptr %105, align 4, !tbaa !11
  %.not92.1 = icmp eq i32 %106, -1
  br i1 %.not92.1, label %114, label %107

107:                                              ; preds = %104
  %108 = sub nsw i32 %26, %106
  %109 = add nsw i32 %.3, 1
  %110 = sext i32 %.3 to i64
  %111 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %110
  store i32 %108, ptr %111, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.1 = getelementptr inbounds i8, ptr %111, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.1, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.1 = getelementptr inbounds i8, ptr %111, i64 8
  store i32 %106, ptr %.sroa.5.0..sroa_idx.1, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.1 = getelementptr inbounds i8, ptr %111, i64 12
  %112 = trunc nuw i64 %indvars.iv127 to i32
  %113 = add nuw nsw i32 %112, 2
  store i32 %113, ptr %.sroa.6.0..sroa_idx.1, align 4, !tbaa !11
  br label %114

114:                                              ; preds = %107, %104
  %.3.1 = phi i32 [ %109, %107 ], [ %.3, %104 ]
  %115 = icmp ult i64 %indvars.iv127, 7
  br i1 %115, label %116, label %._crit_edge, !llvm.loop !15

116:                                              ; preds = %114
  %117 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 3, i64 %77
  %118 = load i32, ptr %117, align 4, !tbaa !11
  %.not92.2 = icmp eq i32 %118, -1
  br i1 %.not92.2, label %126, label %119

119:                                              ; preds = %116
  %120 = sub nsw i32 %26, %118
  %121 = add nsw i32 %.3.1, 1
  %122 = sext i32 %.3.1 to i64
  %123 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %122
  store i32 %120, ptr %123, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.2 = getelementptr inbounds i8, ptr %123, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.2, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.2 = getelementptr inbounds i8, ptr %123, i64 8
  store i32 %118, ptr %.sroa.5.0..sroa_idx.2, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.2 = getelementptr inbounds i8, ptr %123, i64 12
  %124 = trunc nuw i64 %indvars.iv127 to i32
  %125 = add nuw nsw i32 %124, 3
  store i32 %125, ptr %.sroa.6.0..sroa_idx.2, align 4, !tbaa !11
  br label %126

126:                                              ; preds = %119, %116
  %.3.2 = phi i32 [ %121, %119 ], [ %.3.1, %116 ]
  %.not162 = icmp eq i64 %indvars.iv127, 6
  br i1 %.not162, label %._crit_edge, label %127, !llvm.loop !15

127:                                              ; preds = %126
  %128 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 4, i64 %77
  %129 = load i32, ptr %128, align 4, !tbaa !11
  %.not92.3 = icmp eq i32 %129, -1
  br i1 %.not92.3, label %137, label %130

130:                                              ; preds = %127
  %131 = sub nsw i32 %26, %129
  %132 = add nsw i32 %.3.2, 1
  %133 = sext i32 %.3.2 to i64
  %134 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %133
  store i32 %131, ptr %134, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.3 = getelementptr inbounds i8, ptr %134, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.3, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.3 = getelementptr inbounds i8, ptr %134, i64 8
  store i32 %129, ptr %.sroa.5.0..sroa_idx.3, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.3 = getelementptr inbounds i8, ptr %134, i64 12
  %135 = trunc nuw i64 %indvars.iv127 to i32
  %136 = add nuw nsw i32 %135, 4
  store i32 %136, ptr %.sroa.6.0..sroa_idx.3, align 4, !tbaa !11
  br label %137

137:                                              ; preds = %130, %127
  %.3.3 = phi i32 [ %132, %130 ], [ %.3.2, %127 ]
  %138 = icmp ult i64 %indvars.iv127, 5
  br i1 %138, label %139, label %._crit_edge, !llvm.loop !15

139:                                              ; preds = %137
  %140 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 5, i64 %77
  %141 = load i32, ptr %140, align 4, !tbaa !11
  %.not92.4 = icmp eq i32 %141, -1
  br i1 %.not92.4, label %149, label %142

142:                                              ; preds = %139
  %143 = sub nsw i32 %26, %141
  %144 = add nsw i32 %.3.3, 1
  %145 = sext i32 %.3.3 to i64
  %146 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %145
  store i32 %143, ptr %146, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.4 = getelementptr inbounds i8, ptr %146, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.4, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.4 = getelementptr inbounds i8, ptr %146, i64 8
  store i32 %141, ptr %.sroa.5.0..sroa_idx.4, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.4 = getelementptr inbounds i8, ptr %146, i64 12
  %147 = trunc nuw i64 %indvars.iv127 to i32
  %148 = add nuw nsw i32 %147, 5
  store i32 %148, ptr %.sroa.6.0..sroa_idx.4, align 4, !tbaa !11
  br label %149

149:                                              ; preds = %142, %139
  %.3.4 = phi i32 [ %144, %142 ], [ %.3.3, %139 ]
  %.not163 = icmp eq i64 %indvars.iv127, 4
  br i1 %.not163, label %._crit_edge, label %150, !llvm.loop !15

150:                                              ; preds = %149
  %151 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 6, i64 %77
  %152 = load i32, ptr %151, align 4, !tbaa !11
  %.not92.5 = icmp eq i32 %152, -1
  br i1 %.not92.5, label %160, label %153

153:                                              ; preds = %150
  %154 = sub nsw i32 %26, %152
  %155 = add nsw i32 %.3.4, 1
  %156 = sext i32 %.3.4 to i64
  %157 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %156
  store i32 %154, ptr %157, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.5 = getelementptr inbounds i8, ptr %157, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.5, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.5 = getelementptr inbounds i8, ptr %157, i64 8
  store i32 %152, ptr %.sroa.5.0..sroa_idx.5, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.5 = getelementptr inbounds i8, ptr %157, i64 12
  %158 = trunc nuw i64 %indvars.iv127 to i32
  %159 = add nuw nsw i32 %158, 6
  store i32 %159, ptr %.sroa.6.0..sroa_idx.5, align 4, !tbaa !11
  br label %160

160:                                              ; preds = %153, %150
  %.3.5 = phi i32 [ %155, %153 ], [ %.3.4, %150 ]
  %161 = icmp ult i64 %indvars.iv127, 3
  br i1 %161, label %162, label %._crit_edge, !llvm.loop !15

162:                                              ; preds = %160
  %163 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 7, i64 %77
  %164 = load i32, ptr %163, align 4, !tbaa !11
  %.not92.6 = icmp eq i32 %164, -1
  br i1 %.not92.6, label %172, label %165

165:                                              ; preds = %162
  %166 = sub nsw i32 %26, %164
  %167 = add nsw i32 %.3.5, 1
  %168 = sext i32 %.3.5 to i64
  %169 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %168
  store i32 %166, ptr %169, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.6 = getelementptr inbounds i8, ptr %169, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.6, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.6 = getelementptr inbounds i8, ptr %169, i64 8
  store i32 %164, ptr %.sroa.5.0..sroa_idx.6, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.6 = getelementptr inbounds i8, ptr %169, i64 12
  %170 = trunc nuw i64 %indvars.iv127 to i32
  %171 = add nuw nsw i32 %170, 7
  store i32 %171, ptr %.sroa.6.0..sroa_idx.6, align 4, !tbaa !11
  br label %172

172:                                              ; preds = %165, %162
  %.3.6 = phi i32 [ %167, %165 ], [ %.3.5, %162 ]
  %.not164 = icmp eq i64 %indvars.iv127, 2
  br i1 %.not164, label %._crit_edge, label %173, !llvm.loop !15

173:                                              ; preds = %172
  %174 = getelementptr inbounds [10 x [100001 x i32]], ptr @p, i64 0, i64 8, i64 %77
  %175 = load i32, ptr %174, align 4, !tbaa !11
  %.not92.7 = icmp eq i32 %175, -1
  br i1 %.not92.7, label %._crit_edge, label %176

176:                                              ; preds = %173
  %177 = sub nsw i32 %26, %175
  %178 = add nsw i32 %.3.6, 1
  %179 = sext i32 %.3.6 to i64
  %180 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %179
  store i32 %177, ptr %180, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx.7 = getelementptr inbounds i8, ptr %180, i64 4
  store i32 %68, ptr %.sroa.4.0..sroa_idx.7, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx.7 = getelementptr inbounds i8, ptr %180, i64 8
  store i32 %175, ptr %.sroa.5.0..sroa_idx.7, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx.7 = getelementptr inbounds i8, ptr %180, i64 12
  %181 = trunc nuw i64 %indvars.iv127 to i32
  %182 = or disjoint i32 %181, 8
  store i32 %182, ptr %.sroa.6.0..sroa_idx.7, align 4, !tbaa !11
  br label %._crit_edge

._crit_edge111.thread:                            ; preds = %._crit_edge
  %183 = sext i32 %94 to i64
  %184 = getelementptr inbounds [20 x %struct.Node], ptr @e, i64 0, i64 %183
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) @ans, ptr noundef nonnull align 16 dereferenceable(16) %184, i64 16, i1 false), !tbaa.struct !16
  %185 = load i32, ptr @n, align 4, !tbaa !11
  %186 = load i32, ptr @ans, align 4, !tbaa !17
  %187 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !19
  %188 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 8), align 4, !tbaa !20
  %189 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 12), align 4, !tbaa !21
  %190 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %185, i32 noundef %186, i32 noundef %187, i32 noundef %188, i32 noundef %189)
  %191 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %192 = icmp ne i32 %191, -1
  %193 = load i32, ptr @n, align 4
  %194 = icmp ne i32 %193, 0
  %195 = select i1 %192, i1 %194, i1 false
  br i1 %195, label %.lr.ph116, label %._crit_edge117, !llvm.loop !22

196:                                              ; preds = %._crit_edge
  %197 = sub nsw i32 %94, %.278.lcssa
  store i32 %197, ptr @skip, align 4, !tbaa !11
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %198 = icmp ugt i64 %indvars.iv127, 8
  br i1 %198, label %.lr.ph110, label %64, !llvm.loop !23

._crit_edge117:                                   ; preds = %._crit_edge111.thread, %0
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; 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 = { mustprogress nocallback nofree 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = distinct !{!15, !9}
!16 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11}
!17 = !{!18, !12, i64 0}
!18 = !{!"_ZTS4Node", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!19 = !{!18, !12, i64 4}
!20 = !{!18, !12, i64 8}
!21 = !{!18, !12, i64 12}
!22 = distinct !{!22, !9}
!23 = distinct !{!23, !9}


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