; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-04-04 (B - Vector Field - tjz)

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

@direct = external dso_local global ptr, align 8
@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@que = external dso_local global [3010 x i32], align 16
@ord = external dso_local global [3010 x i32], align 16
@pos = external dso_local global [3010 x i32], align 16
@ans = external dso_local global i32, align 4
@e = external dso_local global [3010 x %struct.Node], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5cmp_xRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5cmp_yRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3deli(i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3rebi(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %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
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %64

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %22
  %24 = getelementptr inbounds %struct.Node, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.Node, ptr %27, i32 0, i32 1
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %24, ptr noundef %28, ptr noundef %3)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.Node, ptr %32, i32 0, i32 2
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %49, %20
  %35 = load ptr, ptr @direct, align 8, !tbaa !11
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.Node, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i8, ptr %35, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !13
  %44 = sext i8 %43 to i32
  %45 = load i8, ptr %3, align 1, !tbaa !13
  %46 = sext i8 %45 to i32
  %47 = icmp ne i32 %44, %46
  br i1 %47, label %48, label %56

48:                                               ; preds = %34
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %51
  %53 = getelementptr inbounds %struct.Node, ptr %52, i32 0, i32 2
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !9
  br label %34, !llvm.loop !14

56:                                               ; preds = %34
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %61

61:                                               ; preds = %56
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !16

64:                                               ; preds = %19
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %65

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

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

70:                                               ; preds = %65
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.Node, ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 4, !tbaa !17
  %76 = load i32, ptr @tot, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr @tot, align 4, !tbaa !5
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %78
  store i32 %75, ptr %79, align 4, !tbaa !5
  br label %80

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

83:                                               ; preds = %69
  %84 = load i32, ptr @tot, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr @que, i64 %85
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %86)
  %87 = load i32, ptr @tot, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr @que, i64 %88
  %90 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %89)
  %91 = ptrtoint ptr %90 to i64
  %92 = sub i64 %91, ptrtoint (ptr @que to i64)
  %93 = sdiv exact i64 %92, 4
  %94 = trunc i64 %93 to i32
  store i32 %94, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %117, %83
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

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

100:                                              ; preds = %95
  %101 = load i32, ptr @tot, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr @que, i64 %102
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.Node, ptr %106, i32 0, i32 0
  %108 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %103, ptr noundef nonnull align 4 dereferenceable(4) %107)
  %109 = ptrtoint ptr %108 to i64
  %110 = sub i64 %109, ptrtoint (ptr @que to i64)
  %111 = sdiv exact i64 %110, 4
  %112 = trunc i64 %111 to i32
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.Node, ptr %115, i32 0, i32 0
  store i32 %112, ptr %116, align 4, !tbaa !17
  br label %117

117:                                              ; preds = %100
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %5, align 4, !tbaa !5
  br label %95, !llvm.loop !19

120:                                              ; preds = %99
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %136, %120
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = load i32, ptr @n, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %126, label %125

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

126:                                              ; preds = %121
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %128
  %130 = getelementptr inbounds %struct.Node, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !20
  %132 = load i32, ptr @tot, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr @tot, align 4, !tbaa !5
  %134 = sext i32 %132 to i64
  %135 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %134
  store i32 %131, ptr %135, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %126
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %6, align 4, !tbaa !5
  br label %121, !llvm.loop !21

139:                                              ; preds = %125
  %140 = load i32, ptr @tot, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr @que, i64 %141
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %142)
  %143 = load i32, ptr @tot, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr @que, i64 %144
  %146 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %145)
  %147 = ptrtoint ptr %146 to i64
  %148 = sub i64 %147, ptrtoint (ptr @que to i64)
  %149 = sdiv exact i64 %148, 4
  %150 = trunc i64 %149 to i32
  store i32 %150, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %173, %139
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %176

156:                                              ; preds = %151
  %157 = load i32, ptr @tot, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i32, ptr @que, i64 %158
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %161
  %163 = getelementptr inbounds %struct.Node, ptr %162, i32 0, i32 1
  %164 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %159, ptr noundef nonnull align 4 dereferenceable(4) %163)
  %165 = ptrtoint ptr %164 to i64
  %166 = sub i64 %165, ptrtoint (ptr @que to i64)
  %167 = sdiv exact i64 %166, 4
  %168 = trunc i64 %167 to i32
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %170
  %172 = getelementptr inbounds %struct.Node, ptr %171, i32 0, i32 1
  store i32 %168, ptr %172, align 4, !tbaa !20
  br label %173

173:                                              ; preds = %156
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %7, align 4, !tbaa !5
  br label %151, !llvm.loop !22

176:                                              ; preds = %155
  %177 = load i32, ptr @n, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds i32, ptr @ord, i64 %178
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %179, ptr noundef @_Z5cmp_yRKiS0_)
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %218, %176
  %181 = load i32, ptr %8, align 4, !tbaa !5
  %182 = load i32, ptr @n, align 4, !tbaa !5
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %221

185:                                              ; preds = %180
  %186 = load i32, ptr %8, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %190
  %192 = getelementptr inbounds %struct.Node, ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 4, !tbaa !17
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = load i32, ptr %8, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %201
  %203 = getelementptr inbounds %struct.Node, ptr %202, i32 0, i32 3
  store i32 %196, ptr %203, align 4, !tbaa !23
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = load i32, ptr %8, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %212
  %214 = getelementptr inbounds %struct.Node, ptr %213, i32 0, i32 0
  %215 = load i32, ptr %214, align 4, !tbaa !17
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %216
  store i32 %207, ptr %217, align 4, !tbaa !5
  br label %218

218:                                              ; preds = %185
  %219 = load i32, ptr %8, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %8, align 4, !tbaa !5
  br label %180, !llvm.loop !24

221:                                              ; preds = %184
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %222 = load i32, ptr @n, align 4, !tbaa !5
  %223 = sub nsw i32 %222, 1
  store i32 %223, ptr %9, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %261, %221
  %225 = load i32, ptr %9, align 4, !tbaa !5
  %226 = icmp sge i32 %225, 0
  br i1 %226, label %228, label %227

227:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %264

228:                                              ; preds = %224
  %229 = load i32, ptr %9, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %233
  %235 = getelementptr inbounds %struct.Node, ptr %234, i32 0, i32 0
  %236 = load i32, ptr %235, align 4, !tbaa !17
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = load i32, ptr %9, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %244
  %246 = getelementptr inbounds %struct.Node, ptr %245, i32 0, i32 4
  store i32 %239, ptr %246, align 4, !tbaa !25
  %247 = load i32, ptr %9, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = load i32, ptr %9, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %255
  %257 = getelementptr inbounds %struct.Node, ptr %256, i32 0, i32 0
  %258 = load i32, ptr %257, align 4, !tbaa !17
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %259
  store i32 %250, ptr %260, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %228
  %262 = load i32, ptr %9, align 4, !tbaa !5
  %263 = add nsw i32 %262, -1
  store i32 %263, ptr %9, align 4, !tbaa !5
  br label %224, !llvm.loop !26

264:                                              ; preds = %227
  %265 = load i32, ptr @n, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds i32, ptr @ord, i64 %266
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %267, ptr noundef @_Z5cmp_xRKiS0_)
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %306, %264
  %269 = load i32, ptr %10, align 4, !tbaa !5
  %270 = load i32, ptr @n, align 4, !tbaa !5
  %271 = icmp slt i32 %269, %270
  br i1 %271, label %273, label %272

272:                                              ; preds = %268
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %309

273:                                              ; preds = %268
  %274 = load i32, ptr %10, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %278
  %280 = getelementptr inbounds %struct.Node, ptr %279, i32 0, i32 1
  %281 = load i32, ptr %280, align 4, !tbaa !20
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !5
  %285 = load i32, ptr %10, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %289
  %291 = getelementptr inbounds %struct.Node, ptr %290, i32 0, i32 5
  store i32 %284, ptr %291, align 4, !tbaa !27
  %292 = load i32, ptr %10, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = load i32, ptr %10, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %297
  %299 = load i32, ptr %298, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %300
  %302 = getelementptr inbounds %struct.Node, ptr %301, i32 0, i32 1
  %303 = load i32, ptr %302, align 4, !tbaa !20
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %304
  store i32 %295, ptr %305, align 4, !tbaa !5
  br label %306

306:                                              ; preds = %273
  %307 = load i32, ptr %10, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %10, align 4, !tbaa !5
  br label %268, !llvm.loop !28

309:                                              ; preds = %272
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 12040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %310 = load i32, ptr @n, align 4, !tbaa !5
  %311 = sub nsw i32 %310, 1
  store i32 %311, ptr %11, align 4, !tbaa !5
  br label %312

312:                                              ; preds = %349, %309
  %313 = load i32, ptr %11, align 4, !tbaa !5
  %314 = icmp sge i32 %313, 0
  br i1 %314, label %316, label %315

315:                                              ; preds = %312
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %352

316:                                              ; preds = %312
  %317 = load i32, ptr %11, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %318
  %320 = load i32, ptr %319, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %321
  %323 = getelementptr inbounds %struct.Node, ptr %322, i32 0, i32 1
  %324 = load i32, ptr %323, align 4, !tbaa !20
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %325
  %327 = load i32, ptr %326, align 4, !tbaa !5
  %328 = load i32, ptr %11, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %329
  %331 = load i32, ptr %330, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %332
  %334 = getelementptr inbounds %struct.Node, ptr %333, i32 0, i32 6
  store i32 %327, ptr %334, align 4, !tbaa !29
  %335 = load i32, ptr %11, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %336
  %338 = load i32, ptr %337, align 4, !tbaa !5
  %339 = load i32, ptr %11, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %340
  %342 = load i32, ptr %341, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %343
  %345 = getelementptr inbounds %struct.Node, ptr %344, i32 0, i32 1
  %346 = load i32, ptr %345, align 4, !tbaa !20
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %347
  store i32 %338, ptr %348, align 4, !tbaa !5
  br label %349

349:                                              ; preds = %316
  %350 = load i32, ptr %11, align 4, !tbaa !5
  %351 = add nsw i32 %350, -1
  store i32 %351, ptr %11, align 4, !tbaa !5
  br label %312, !llvm.loop !30

352:                                              ; preds = %315
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  br label %353

353:                                              ; preds = %395, %352
  %354 = load i32, ptr %12, align 4, !tbaa !5
  %355 = load i32, ptr @n, align 4, !tbaa !5
  %356 = icmp slt i32 %354, %355
  br i1 %356, label %358, label %357

357:                                              ; preds = %353
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %398

358:                                              ; preds = %353
  store i32 0, ptr @tot, align 4, !tbaa !5
  %359 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %359, ptr %13, align 4, !tbaa !5
  %360 = load i32, ptr @tot, align 4, !tbaa !5
  %361 = add nsw i32 %360, 1
  store i32 %361, ptr @tot, align 4, !tbaa !5
  %362 = sext i32 %360 to i64
  %363 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %362
  store i32 %359, ptr %363, align 4, !tbaa !5
  %364 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3deli(i32 noundef %364)
  br label %365

365:                                              ; preds = %370, %358
  %366 = load i32, ptr %13, align 4, !tbaa !5
  %367 = call noundef i32 @_Z3nxti(i32 noundef %366)
  store i32 %367, ptr %13, align 4, !tbaa !5
  %368 = icmp ne i32 %367, -1
  br i1 %368, label %369, label %377

369:                                              ; preds = %365
  br label %370

370:                                              ; preds = %369
  %371 = load i32, ptr %13, align 4, !tbaa !5
  %372 = load i32, ptr @tot, align 4, !tbaa !5
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr @tot, align 4, !tbaa !5
  %374 = sext i32 %372 to i64
  %375 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %374
  store i32 %371, ptr %375, align 4, !tbaa !5
  %376 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3deli(i32 noundef %376)
  br label %365, !llvm.loop !31

377:                                              ; preds = %365
  %378 = load i32, ptr @ans, align 4, !tbaa !5
  %379 = load i32, ptr @tot, align 4, !tbaa !5
  %380 = icmp slt i32 %378, %379
  br i1 %380, label %381, label %383

381:                                              ; preds = %377
  %382 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %382, ptr @ans, align 4, !tbaa !5
  br label %383

383:                                              ; preds = %381, %377
  br label %384

384:                                              ; preds = %388, %383
  %385 = load i32, ptr @tot, align 4, !tbaa !5
  %386 = icmp ne i32 %385, 0
  br i1 %386, label %387, label %394

387:                                              ; preds = %384
  br label %388

388:                                              ; preds = %387
  %389 = load i32, ptr @tot, align 4, !tbaa !5
  %390 = add nsw i32 %389, -1
  store i32 %390, ptr @tot, align 4, !tbaa !5
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %391
  %393 = load i32, ptr %392, align 4, !tbaa !5
  call void @_Z3rebi(i32 noundef %393)
  br label %384, !llvm.loop !32

394:                                              ; preds = %384
  br label %395

395:                                              ; preds = %394
  %396 = load i32, ptr %12, align 4, !tbaa !5
  %397 = add nsw i32 %396, 1
  store i32 %397, ptr %12, align 4, !tbaa !5
  br label %353, !llvm.loop !33

398:                                              ; preds = %357
  %399 = load i32, ptr @ans, align 4, !tbaa !5
  %400 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %399)
  ret i32 0
}

declare i32 @__isoc99_scanf(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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3nxti(i32 noundef) #6

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

attributes #0 = { 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 #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!10, !6, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = !{!10, !6, i64 4}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
!23 = !{!10, !6, i64 12}
!24 = distinct !{!24, !15}
!25 = !{!10, !6, i64 16}
!26 = distinct !{!26, !15}
!27 = !{!10, !6, i64 20}
!28 = distinct !{!28, !15}
!29 = !{!10, !6, i64 24}
!30 = distinct !{!30, !15}
!31 = distinct !{!31, !15}
!32 = distinct !{!32, !15}
!33 = distinct !{!33, !15}


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

@direct = external dso_local local_unnamed_addr global ptr, align 8
@n = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [3010 x i32], align 16
@ord = external dso_local global [3010 x i32], align 16
@pos = external dso_local local_unnamed_addr global [3010 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local global [3010 x %struct.Node], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5cmp_xRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5cmp_yRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3deli(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3rebi(i32 noundef) local_unnamed_addr #0

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

._crit_edge:                                      ; preds = %52
  store i32 0, ptr @tot, align 4, !tbaa !5
  %5 = icmp sgt i32 %55, 0
  br i1 %5, label %.lr.ph77.preheader, label %59

.lr.ph77.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %55 to i64
  %min.iters.check = icmp ult i32 %55, 9
  br i1 %min.iters.check, label %.lr.ph77.preheader184, label %vector.ph

.lr.ph77.preheader184:                            ; preds = %vector.body, %.lr.ph77.preheader
  %indvars.iv132.ph = phi i64 [ 0, %.lr.ph77.preheader ], [ %n.vec, %vector.body ]
  br label %.lr.ph77

vector.ph:                                        ; preds = %.lr.ph77.preheader
  %n.mod.vf = and i64 %wide.trip.count, 7
  %6 = icmp eq i64 %n.mod.vf, 0
  %7 = select i1 %6, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %wide.trip.count, %7
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %8 = or disjoint i64 %index, 1
  %9 = or disjoint i64 %index, 2
  %10 = or disjoint i64 %index, 3
  %11 = or disjoint i64 %index, 4
  %12 = or disjoint i64 %index, 5
  %13 = or disjoint i64 %index, 6
  %14 = or disjoint i64 %index, 7
  %15 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %index
  %16 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %8
  %17 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %9
  %18 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %10
  %19 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %11
  %20 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %12
  %21 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %13
  %22 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %14
  %23 = load i32, ptr %15, align 16, !tbaa !9
  %24 = load i32, ptr %16, align 4, !tbaa !9
  %25 = load i32, ptr %17, align 8, !tbaa !9
  %26 = load i32, ptr %18, align 4, !tbaa !9
  %27 = insertelement <4 x i32> poison, i32 %23, i64 0
  %28 = insertelement <4 x i32> %27, i32 %24, i64 1
  %29 = insertelement <4 x i32> %28, i32 %25, i64 2
  %30 = insertelement <4 x i32> %29, i32 %26, i64 3
  %31 = load i32, ptr %19, align 16, !tbaa !9
  %32 = load i32, ptr %20, align 4, !tbaa !9
  %33 = load i32, ptr %21, align 8, !tbaa !9
  %34 = load i32, ptr %22, align 4, !tbaa !9
  %35 = insertelement <4 x i32> poison, i32 %31, i64 0
  %36 = insertelement <4 x i32> %35, i32 %32, i64 1
  %37 = insertelement <4 x i32> %36, i32 %33, i64 2
  %38 = insertelement <4 x i32> %37, i32 %34, i64 3
  %39 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %index
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  store <4 x i32> %30, ptr %39, align 16, !tbaa !5
  store <4 x i32> %38, ptr %40, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %41 = icmp eq i64 %index.next, %n.vec
  br i1 %41, label %.lr.ph77.preheader184, label %vector.body, !llvm.loop !11

.lr.ph:                                           ; preds = %0, %52
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %52 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #7
  %42 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %indvars.iv129
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %42, ptr noundef nonnull %43, ptr noundef nonnull %1)
  %45 = getelementptr inbounds i8, ptr %42, i64 8
  %46 = load ptr, ptr @direct, align 8, !tbaa !15
  %47 = load i8, ptr %1, align 1, !tbaa !17
  br label %48

48:                                               ; preds = %48, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ 0, %.lr.ph ]
  %49 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %49, ptr %45, align 4, !tbaa !18
  %50 = getelementptr inbounds i8, ptr %46, i64 %indvars.iv
  %51 = load i8, ptr %50, align 1, !tbaa !17
  %.not69 = icmp eq i8 %51, %47
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not69, label %52, label %48, !llvm.loop !19

52:                                               ; preds = %48
  %53 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv129
  %54 = trunc nuw nsw i64 %indvars.iv129 to i32
  store i32 %54, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #7
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next130, %56
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !20

.sink.split:                                      ; preds = %.lr.ph77, %0
  %.sink = phi i32 [ 0, %0 ], [ %55, %.lr.ph77 ]
  store i32 %.sink, ptr @tot, align 4, !tbaa !5
  %58 = zext nneg i32 %.sink to i64
  br label %59

59:                                               ; preds = %.sink.split, %._crit_edge
  %60 = phi i64 [ 0, %._crit_edge ], [ %58, %.sink.split ]
  %61 = getelementptr inbounds i32, ptr @que, i64 %60
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %61)
  %62 = load i32, ptr @tot, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr @que, i64 %63
  %65 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %64)
  %66 = ptrtoint ptr %65 to i64
  %67 = sub i64 %66, ptrtoint (ptr @que to i64)
  %68 = lshr exact i64 %67, 2
  %69 = trunc i64 %68 to i32
  store i32 %69, ptr @tot, align 4, !tbaa !5
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph82, label %._crit_edge83.thread

._crit_edge83.thread:                             ; preds = %59
  store i32 0, ptr @tot, align 4, !tbaa !5
  br label %125

.lr.ph77:                                         ; preds = %.lr.ph77.preheader184, %.lr.ph77
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %.lr.ph77 ], [ %indvars.iv132.ph, %.lr.ph77.preheader184 ]
  %72 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %indvars.iv132
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %74 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %indvars.iv132
  store i32 %73, ptr %74, align 4, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next133, %wide.trip.count
  br i1 %exitcond.not, label %.sink.split, label %.lr.ph77, !llvm.loop !21

._crit_edge83:                                    ; preds = %.lr.ph82
  store i32 0, ptr @tot, align 4, !tbaa !5
  %75 = icmp sgt i32 %121, 0
  br i1 %75, label %.lr.ph88.preheader, label %125

.lr.ph88.preheader:                               ; preds = %._crit_edge83
  %wide.trip.count145 = zext nneg i32 %121 to i64
  %min.iters.check174 = icmp ult i32 %121, 9
  br i1 %min.iters.check174, label %.lr.ph88.preheader182, label %vector.ph175

.lr.ph88.preheader182:                            ; preds = %vector.body179, %.lr.ph88.preheader
  %indvars.iv140.ph = phi i64 [ 0, %.lr.ph88.preheader ], [ %n.vec177, %vector.body179 ]
  br label %.lr.ph88

vector.ph175:                                     ; preds = %.lr.ph88.preheader
  %n.mod.vf176 = and i64 %wide.trip.count145, 7
  %76 = icmp eq i64 %n.mod.vf176, 0
  %77 = select i1 %76, i64 8, i64 %n.mod.vf176
  %n.vec177 = sub nsw i64 %wide.trip.count145, %77
  br label %vector.body179

vector.body179:                                   ; preds = %vector.body179, %vector.ph175
  %index180 = phi i64 [ 0, %vector.ph175 ], [ %index.next181, %vector.body179 ]
  %78 = or disjoint i64 %index180, 1
  %79 = or disjoint i64 %index180, 2
  %80 = or disjoint i64 %index180, 3
  %81 = or disjoint i64 %index180, 4
  %82 = or disjoint i64 %index180, 5
  %83 = or disjoint i64 %index180, 6
  %84 = or disjoint i64 %index180, 7
  %85 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %index180, i32 1
  %86 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %78, i32 1
  %87 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %79, i32 1
  %88 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %80, i32 1
  %89 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %81, i32 1
  %90 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %82, i32 1
  %91 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %83, i32 1
  %92 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %84, i32 1
  %93 = load i32, ptr %85, align 4, !tbaa !22
  %94 = load i32, ptr %86, align 16, !tbaa !22
  %95 = load i32, ptr %87, align 4, !tbaa !22
  %96 = load i32, ptr %88, align 8, !tbaa !22
  %97 = insertelement <4 x i32> poison, i32 %93, i64 0
  %98 = insertelement <4 x i32> %97, i32 %94, i64 1
  %99 = insertelement <4 x i32> %98, i32 %95, i64 2
  %100 = insertelement <4 x i32> %99, i32 %96, i64 3
  %101 = load i32, ptr %89, align 4, !tbaa !22
  %102 = load i32, ptr %90, align 16, !tbaa !22
  %103 = load i32, ptr %91, align 4, !tbaa !22
  %104 = load i32, ptr %92, align 8, !tbaa !22
  %105 = insertelement <4 x i32> poison, i32 %101, i64 0
  %106 = insertelement <4 x i32> %105, i32 %102, i64 1
  %107 = insertelement <4 x i32> %106, i32 %103, i64 2
  %108 = insertelement <4 x i32> %107, i32 %104, i64 3
  %109 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %index180
  %110 = getelementptr inbounds i8, ptr %109, i64 16
  store <4 x i32> %100, ptr %109, align 16, !tbaa !5
  store <4 x i32> %108, ptr %110, align 16, !tbaa !5
  %index.next181 = add nuw i64 %index180, 8
  %111 = icmp eq i64 %index.next181, %n.vec177
  br i1 %111, label %.lr.ph88.preheader182, label %vector.body179, !llvm.loop !23

.lr.ph82:                                         ; preds = %59, %.lr.ph82
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %.lr.ph82 ], [ 0, %59 ]
  %112 = load i32, ptr @tot, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr @que, i64 %113
  %115 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %indvars.iv137
  %116 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %114, ptr noundef nonnull align 4 dereferenceable(4) %115)
  %117 = ptrtoint ptr %116 to i64
  %118 = sub i64 %117, ptrtoint (ptr @que to i64)
  %119 = lshr exact i64 %118, 2
  %120 = trunc i64 %119 to i32
  store i32 %120, ptr %115, align 4, !tbaa !9
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = icmp slt i64 %indvars.iv.next138, %122
  br i1 %123, label %.lr.ph82, label %._crit_edge83, !llvm.loop !24

._crit_edge89:                                    ; preds = %.lr.ph88
  store i32 %121, ptr @tot, align 4, !tbaa !5
  %124 = zext nneg i32 %121 to i64
  br label %125

125:                                              ; preds = %._crit_edge83.thread, %._crit_edge89, %._crit_edge83
  %126 = phi i64 [ %124, %._crit_edge89 ], [ 0, %._crit_edge83 ], [ 0, %._crit_edge83.thread ]
  %127 = getelementptr inbounds i32, ptr @que, i64 %126
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %127)
  %128 = load i32, ptr @tot, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr @que, i64 %129
  %131 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %130)
  %132 = ptrtoint ptr %131 to i64
  %133 = sub i64 %132, ptrtoint (ptr @que to i64)
  %134 = lshr exact i64 %133, 2
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr @tot, align 4, !tbaa !5
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %.lr.ph93, label %.._crit_edge94_crit_edge

.._crit_edge94_crit_edge:                         ; preds = %125
  %.pre = sext i32 %136 to i64
  br label %._crit_edge94

.lr.ph88:                                         ; preds = %.lr.ph88.preheader182, %.lr.ph88
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %.lr.ph88 ], [ %indvars.iv140.ph, %.lr.ph88.preheader182 ]
  %138 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %indvars.iv140, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !22
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %140 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %indvars.iv140
  store i32 %139, ptr %140, align 4, !tbaa !5
  %exitcond146.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count145
  br i1 %exitcond146.not, label %._crit_edge89, label %.lr.ph88, !llvm.loop !25

._crit_edge94:                                    ; preds = %.lr.ph93, %.._crit_edge94_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge94_crit_edge ], [ %156, %.lr.ph93 ]
  %141 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %141, ptr noundef nonnull @_Z5cmp_yRKiS0_)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @pos, i8 -1, i64 12040, i1 false)
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %.lr.ph98.preheader, label %._crit_edge104

.lr.ph98.preheader:                               ; preds = %._crit_edge94
  %wide.trip.count153 = zext nneg i32 %142 to i64
  %144 = add nsw i64 %wide.trip.count153, -1
  %xtraiter = and i64 %wide.trip.count153, 1
  %145 = icmp eq i64 %144, 0
  br i1 %145, label %._crit_edge99.unr-lcssa, label %.lr.ph98.preheader.new

.lr.ph98.preheader.new:                           ; preds = %.lr.ph98.preheader
  %unroll_iter = and i64 %wide.trip.count153, 2147483646
  br label %.lr.ph98

.lr.ph93:                                         ; preds = %125, %.lr.ph93
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph93 ], [ 0, %125 ]
  %146 = load i32, ptr @tot, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr @que, i64 %147
  %149 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %indvars.iv147, i32 1
  %150 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %148, ptr noundef nonnull align 4 dereferenceable(4) %149)
  %151 = ptrtoint ptr %150 to i64
  %152 = sub i64 %151, ptrtoint (ptr @que to i64)
  %153 = lshr exact i64 %152, 2
  %154 = trunc i64 %153 to i32
  store i32 %154, ptr %149, align 4, !tbaa !22
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %155 = load i32, ptr @n, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = icmp slt i64 %indvars.iv.next148, %156
  br i1 %157, label %.lr.ph93, label %._crit_edge94, !llvm.loop !26

._crit_edge99.unr-lcssa:                          ; preds = %.lr.ph98, %.lr.ph98.preheader
  %indvars.iv150.unr = phi i64 [ 0, %.lr.ph98.preheader ], [ %indvars.iv.next151.1, %.lr.ph98 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge99, label %.lr.ph98.epil

.lr.ph98.epil:                                    ; preds = %._crit_edge99.unr-lcssa
  %158 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv150.unr
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %161, i64 12
  store i32 %165, ptr %166, align 4, !tbaa !27
  store i32 %159, ptr %164, align 4, !tbaa !5
  br label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge99.unr-lcssa, %.lr.ph98.epil
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @pos, i8 -1, i64 12040, i1 false)
  br i1 %143, label %.lr.ph103.preheader, label %._crit_edge104

.lr.ph103.preheader:                              ; preds = %._crit_edge99
  %167 = zext nneg i32 %142 to i64
  %xtraiter186 = and i64 %wide.trip.count153, 1
  %lcmp.mod187.not = icmp eq i64 %xtraiter186, 0
  br i1 %lcmp.mod187.not, label %.lr.ph103.prol.loopexit, label %.lr.ph103.prol

.lr.ph103.prol:                                   ; preds = %.lr.ph103.preheader
  %indvars.iv.next156.prol = add nsw i64 %167, -1
  %168 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next156.prol
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = getelementptr inbounds i8, ptr %171, i64 16
  store i32 %175, ptr %176, align 4, !tbaa !28
  store i32 %169, ptr %174, align 4, !tbaa !5
  br label %.lr.ph103.prol.loopexit

.lr.ph103.prol.loopexit:                          ; preds = %.lr.ph103.prol, %.lr.ph103.preheader
  %indvars.iv155.unr = phi i64 [ %167, %.lr.ph103.preheader ], [ %indvars.iv.next156.prol, %.lr.ph103.prol ]
  %177 = icmp eq i64 %144, 0
  br i1 %177, label %._crit_edge104, label %.lr.ph103

.lr.ph98:                                         ; preds = %.lr.ph98, %.lr.ph98.preheader.new
  %indvars.iv150 = phi i64 [ 0, %.lr.ph98.preheader.new ], [ %indvars.iv.next151.1, %.lr.ph98 ]
  %niter = phi i64 [ 0, %.lr.ph98.preheader.new ], [ %niter.next.1, %.lr.ph98 ]
  %178 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv150
  %179 = load i32, ptr %178, align 8, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = getelementptr inbounds i8, ptr %181, i64 12
  store i32 %185, ptr %186, align 4, !tbaa !27
  store i32 %179, ptr %184, align 4, !tbaa !5
  %indvars.iv.next151 = or disjoint i64 %indvars.iv150, 1
  %187 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next151
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = getelementptr inbounds i8, ptr %190, i64 12
  store i32 %194, ptr %195, align 4, !tbaa !27
  store i32 %188, ptr %193, align 4, !tbaa !5
  %indvars.iv.next151.1 = add nuw nsw i64 %indvars.iv150, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge99.unr-lcssa, label %.lr.ph98, !llvm.loop !29

._crit_edge104:                                   ; preds = %.lr.ph103.prol.loopexit, %.lr.ph103, %._crit_edge94, %._crit_edge99
  %196 = sext i32 %142 to i64
  %197 = getelementptr inbounds i32, ptr @ord, i64 %196
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %197, ptr noundef nonnull @_Z5cmp_xRKiS0_)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @pos, i8 -1, i64 12040, i1 false)
  %198 = load i32, ptr @n, align 4, !tbaa !5
  %199 = icmp sgt i32 %198, 0
  br i1 %199, label %.lr.ph107.preheader, label %._crit_edge123

.lr.ph107.preheader:                              ; preds = %._crit_edge104
  %wide.trip.count161 = zext nneg i32 %198 to i64
  %200 = add nsw i64 %wide.trip.count161, -1
  %xtraiter188 = and i64 %wide.trip.count161, 1
  %201 = icmp eq i64 %200, 0
  br i1 %201, label %._crit_edge108.unr-lcssa, label %.lr.ph107.preheader.new

.lr.ph107.preheader.new:                          ; preds = %.lr.ph107.preheader
  %unroll_iter190 = and i64 %wide.trip.count161, 2147483646
  br label %.lr.ph107

.lr.ph103:                                        ; preds = %.lr.ph103.prol.loopexit, %.lr.ph103
  %indvars.iv155 = phi i64 [ %indvars.iv.next156.1, %.lr.ph103 ], [ %indvars.iv155.unr, %.lr.ph103.prol.loopexit ]
  %indvars.iv.next156 = add nsw i64 %indvars.iv155, -1
  %202 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next156
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = getelementptr inbounds i8, ptr %205, i64 16
  store i32 %209, ptr %210, align 4, !tbaa !28
  store i32 %203, ptr %208, align 4, !tbaa !5
  %indvars.iv.next156.1 = add nsw i64 %indvars.iv155, -2
  %211 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next156.1
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = getelementptr inbounds i8, ptr %214, i64 16
  store i32 %218, ptr %219, align 4, !tbaa !28
  store i32 %212, ptr %217, align 4, !tbaa !5
  %220 = icmp ugt i64 %indvars.iv.next156, 1
  br i1 %220, label %.lr.ph103, label %._crit_edge104, !llvm.loop !30

._crit_edge108.unr-lcssa:                         ; preds = %.lr.ph107, %.lr.ph107.preheader
  %indvars.iv158.unr = phi i64 [ 0, %.lr.ph107.preheader ], [ %indvars.iv.next159.1, %.lr.ph107 ]
  %lcmp.mod189.not = icmp eq i64 %xtraiter188, 0
  br i1 %lcmp.mod189.not, label %._crit_edge108, label %.lr.ph107.epil

.lr.ph107.epil:                                   ; preds = %._crit_edge108.unr-lcssa
  %221 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv158.unr
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %223
  %225 = getelementptr inbounds i8, ptr %224, i64 4
  %226 = load i32, ptr %225, align 4, !tbaa !22
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = getelementptr inbounds i8, ptr %224, i64 20
  store i32 %229, ptr %230, align 4, !tbaa !31
  store i32 %222, ptr %228, align 4, !tbaa !5
  br label %._crit_edge108

._crit_edge108:                                   ; preds = %._crit_edge108.unr-lcssa, %.lr.ph107.epil
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(12040) @pos, i8 -1, i64 12040, i1 false)
  br i1 %199, label %.lr.ph112.preheader, label %._crit_edge123

.lr.ph112.preheader:                              ; preds = %._crit_edge108
  %231 = zext nneg i32 %198 to i64
  %xtraiter192 = and i64 %wide.trip.count161, 1
  %lcmp.mod193.not = icmp eq i64 %xtraiter192, 0
  br i1 %lcmp.mod193.not, label %.lr.ph112.prol.loopexit, label %.lr.ph112.prol

.lr.ph112.prol:                                   ; preds = %.lr.ph112.preheader
  %indvars.iv.next164.prol = add nsw i64 %231, -1
  %232 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next164.prol
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %234
  %236 = getelementptr inbounds i8, ptr %235, i64 4
  %237 = load i32, ptr %236, align 4, !tbaa !22
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = getelementptr inbounds i8, ptr %235, i64 24
  store i32 %240, ptr %241, align 4, !tbaa !32
  store i32 %233, ptr %239, align 4, !tbaa !5
  br label %.lr.ph112.prol.loopexit

.lr.ph112.prol.loopexit:                          ; preds = %.lr.ph112.prol, %.lr.ph112.preheader
  %indvars.iv163.unr = phi i64 [ %231, %.lr.ph112.preheader ], [ %indvars.iv.next164.prol, %.lr.ph112.prol ]
  %242 = icmp eq i64 %200, 0
  br i1 %242, label %.preheader, label %.lr.ph112

.lr.ph107:                                        ; preds = %.lr.ph107, %.lr.ph107.preheader.new
  %indvars.iv158 = phi i64 [ 0, %.lr.ph107.preheader.new ], [ %indvars.iv.next159.1, %.lr.ph107 ]
  %niter191 = phi i64 [ 0, %.lr.ph107.preheader.new ], [ %niter191.next.1, %.lr.ph107 ]
  %243 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv158
  %244 = load i32, ptr %243, align 8, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %245
  %247 = getelementptr inbounds i8, ptr %246, i64 4
  %248 = load i32, ptr %247, align 4, !tbaa !22
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = getelementptr inbounds i8, ptr %246, i64 20
  store i32 %251, ptr %252, align 4, !tbaa !31
  store i32 %244, ptr %250, align 4, !tbaa !5
  %indvars.iv.next159 = or disjoint i64 %indvars.iv158, 1
  %253 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next159
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %255
  %257 = getelementptr inbounds i8, ptr %256, i64 4
  %258 = load i32, ptr %257, align 4, !tbaa !22
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = getelementptr inbounds i8, ptr %256, i64 20
  store i32 %261, ptr %262, align 4, !tbaa !31
  store i32 %254, ptr %260, align 4, !tbaa !5
  %indvars.iv.next159.1 = add nuw nsw i64 %indvars.iv158, 2
  %niter191.next.1 = add i64 %niter191, 2
  %niter191.ncmp.1 = icmp eq i64 %niter191.next.1, %unroll_iter190
  br i1 %niter191.ncmp.1, label %._crit_edge108.unr-lcssa, label %.lr.ph107, !llvm.loop !33

.preheader:                                       ; preds = %.lr.ph112, %.lr.ph112.prol.loopexit
  br i1 %199, label %.lr.ph122, label %._crit_edge123

.lr.ph112:                                        ; preds = %.lr.ph112.prol.loopexit, %.lr.ph112
  %indvars.iv163 = phi i64 [ %indvars.iv.next164.1, %.lr.ph112 ], [ %indvars.iv163.unr, %.lr.ph112.prol.loopexit ]
  %indvars.iv.next164 = add nsw i64 %indvars.iv163, -1
  %263 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next164
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %265
  %267 = getelementptr inbounds i8, ptr %266, i64 4
  %268 = load i32, ptr %267, align 4, !tbaa !22
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = getelementptr inbounds i8, ptr %266, i64 24
  store i32 %271, ptr %272, align 4, !tbaa !32
  store i32 %264, ptr %270, align 4, !tbaa !5
  %indvars.iv.next164.1 = add nsw i64 %indvars.iv163, -2
  %273 = getelementptr inbounds [3010 x i32], ptr @ord, i64 0, i64 %indvars.iv.next164.1
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [3010 x %struct.Node], ptr @e, i64 0, i64 %275
  %277 = getelementptr inbounds i8, ptr %276, i64 4
  %278 = load i32, ptr %277, align 4, !tbaa !22
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [3010 x i32], ptr @pos, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = getelementptr inbounds i8, ptr %276, i64 24
  store i32 %281, ptr %282, align 4, !tbaa !32
  store i32 %274, ptr %280, align 4, !tbaa !5
  %283 = icmp ugt i64 %indvars.iv.next164, 1
  br i1 %283, label %.lr.ph112, label %.preheader, !llvm.loop !34

._crit_edge123:                                   ; preds = %._crit_edge120, %._crit_edge104, %._crit_edge108, %.preheader
  %284 = load i32, ptr @ans, align 4, !tbaa !5
  %285 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %284)
  ret i32 0

.lr.ph122:                                        ; preds = %.preheader, %._crit_edge120
  %.054121 = phi i32 [ %304, %._crit_edge120 ], [ 0, %.preheader ]
  store i32 1, ptr @tot, align 4, !tbaa !5
  store i32 %.054121, ptr @que, align 16, !tbaa !5
  call void @_Z3deli(i32 noundef %.054121)
  %286 = call noundef i32 @_Z3nxti(i32 noundef %.054121)
  %.not113 = icmp eq i32 %286, -1
  br i1 %.not113, label %._crit_edge116, label %.lr.ph115

.lr.ph115:                                        ; preds = %.lr.ph122, %.lr.ph115
  %287 = phi i32 [ %292, %.lr.ph115 ], [ %286, %.lr.ph122 ]
  %288 = load i32, ptr @tot, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr @tot, align 4, !tbaa !5
  %290 = sext i32 %288 to i64
  %291 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %290
  store i32 %287, ptr %291, align 4, !tbaa !5
  call void @_Z3deli(i32 noundef %287)
  %292 = call noundef i32 @_Z3nxti(i32 noundef %287)
  %.not = icmp eq i32 %292, -1
  br i1 %.not, label %._crit_edge116, label %.lr.ph115, !llvm.loop !35

._crit_edge116:                                   ; preds = %.lr.ph115, %.lr.ph122
  %293 = load i32, ptr @ans, align 4, !tbaa !5
  %294 = load i32, ptr @tot, align 4, !tbaa !5
  %295 = icmp slt i32 %293, %294
  br i1 %295, label %296, label %297

296:                                              ; preds = %._crit_edge116
  store i32 %294, ptr @ans, align 4, !tbaa !5
  br label %297

297:                                              ; preds = %296, %._crit_edge116
  %.not68117 = icmp eq i32 %294, 0
  br i1 %.not68117, label %._crit_edge120, label %.lr.ph119

.lr.ph119:                                        ; preds = %297, %.lr.ph119
  %298 = phi i32 [ %303, %.lr.ph119 ], [ %294, %297 ]
  %299 = add nsw i32 %298, -1
  store i32 %299, ptr @tot, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [3010 x i32], ptr @que, i64 0, i64 %300
  %302 = load i32, ptr %301, align 4, !tbaa !5
  call void @_Z3rebi(i32 noundef %302)
  %303 = load i32, ptr @tot, align 4, !tbaa !5
  %.not68 = icmp eq i32 %303, 0
  br i1 %.not68, label %._crit_edge120, label %.lr.ph119, !llvm.loop !36

._crit_edge120:                                   ; preds = %.lr.ph119, %297
  %304 = add nuw nsw i32 %.054121, 1
  %305 = load i32, ptr @n, align 4, !tbaa !5
  %306 = icmp slt i32 %304, %305
  br i1 %306, label %.lr.ph122, label %._crit_edge123, !llvm.loop !37
}

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3nxti(i32 noundef) local_unnamed_addr #6

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

attributes #0 = { 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 #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !6, i64 8}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !14, !13}
!22 = !{!10, !6, i64 4}
!23 = distinct !{!23, !12, !13, !14}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !14, !13}
!26 = distinct !{!26, !12}
!27 = !{!10, !6, i64 12}
!28 = !{!10, !6, i64 16}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}
!31 = !{!10, !6, i64 20}
!32 = !{!10, !6, i64 24}
!33 = distinct !{!33, !12}
!34 = distinct !{!34, !12}
!35 = distinct !{!35, !12}
!36 = distinct !{!36, !12}
!37 = distinct !{!37, !12}


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