; LLVM IR from tangjz/acm-icpc :: codeforces/complete/757G.ll (Z10tree_buildii)

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

@tot = external dso_local global i32, align 4
@lnk = external dso_local global [400001 x i32], align 16
@ord = external dso_local global [400001 x i32], align 16
@fa = external dso_local global [400001 x i32], align 16
@e = external dso_local global [800003 x %struct.Edge], align 16
@ban = external dso_local global [400001 x i8], align 16
@dis = external dso_local global [31 x [400001 x i64]], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._Z10tree_buildii = external hidden unnamed_addr constant [26 x i8], align 1
@_ZZ10tree_buildiiE2sz = external hidden global [400001 x i32], align 16

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10tree_buildii(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %27
  store i32 0, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z3bfsi(i32 noundef %29)
  %30 = load i32, ptr @tot, align 4, !tbaa !5
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %2
  br label %343

33:                                               ; preds = %2
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 31
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  br label %39

37:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.2, i32 noundef 70, ptr noundef @__PRETTY_FUNCTION__._Z10tree_buildii) #5
  unreachable

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %40 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %40, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %41 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %41, ptr %6, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %120, %39
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 1
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %123

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [400001 x i32], ptr @ord, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr %8, align 4, !tbaa !5
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %52
  store i32 1, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  store i32 %57, ptr %9, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %95, %46
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %101

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.Edge, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !9
  store i32 %67, ptr %10, align 4, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %68, %72
  br i1 %73, label %81, label %74

74:                                               ; preds = %62
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = ashr i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !11, !range !13, !noundef !14
  %80 = trunc i8 %79 to i1
  br i1 %80, label %81, label %82

81:                                               ; preds = %74, %62
  store i32 7, ptr %7, align 4
  br label %92

82:                                               ; preds = %74
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = add nsw i32 %90, %86
  store i32 %91, ptr %89, align 4, !tbaa !5
  store i32 0, ptr %7, align 4
  br label %92

92:                                               ; preds = %82, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %93 = load i32, ptr %7, align 4
  switch i32 %93, label %344 [
    i32 0, label %94
    i32 7, label %95
  ]

94:                                               ; preds = %92
  br label %95

95:                                               ; preds = %94, %92
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.Edge, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !15
  store i32 %100, ptr %9, align 4, !tbaa !5
  br label %58, !llvm.loop !16

101:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %105 = load i32, ptr @tot, align 4, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = sub nsw i32 %105, %109
  store i32 %110, ptr %12, align 4, !tbaa !5
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %104, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %112 = load i32, ptr %111, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  store i32 %112, ptr %11, align 4, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %101
  %117 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %117, ptr %5, align 4, !tbaa !5
  %118 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %118, ptr %4, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %116, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr %6, align 4, !tbaa !5
  br label %42, !llvm.loop !18

123:                                              ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %128 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %128, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  store i32 %132, ptr %16, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %160, %123
  %134 = load i32, ptr %16, align 4, !tbaa !5
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %137, label %136

136:                                              ; preds = %133
  store i32 8, ptr %7, align 4
  br label %166

137:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %138 = load i32, ptr %16, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %139
  %141 = getelementptr inbounds %struct.Edge, ptr %140, i32 0, i32 1
  %142 = load i32, ptr %141, align 4, !tbaa !9
  store i32 %142, ptr %17, align 4, !tbaa !5
  %143 = load i32, ptr %17, align 4, !tbaa !5
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = icmp eq i32 %143, %144
  br i1 %145, label %146, label %156

146:                                              ; preds = %137
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %148
  %150 = getelementptr inbounds %struct.Edge, ptr %149, i32 0, i32 2
  %151 = load i32, ptr %150, align 4, !tbaa !19
  store i32 %151, ptr %15, align 4, !tbaa !5
  %152 = load i32, ptr %16, align 4, !tbaa !5
  %153 = ashr i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %154
  store i8 1, ptr %155, align 1, !tbaa !11
  store i32 8, ptr %7, align 4
  br label %157

156:                                              ; preds = %137
  store i32 0, ptr %7, align 4
  br label %157

157:                                              ; preds = %156, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %158 = load i32, ptr %7, align 4
  switch i32 %158, label %166 [
    i32 0, label %159
  ]

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %162
  %164 = getelementptr inbounds %struct.Edge, ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 4, !tbaa !15
  store i32 %165, ptr %16, align 4, !tbaa !5
  br label %133, !llvm.loop !20

166:                                              ; preds = %157, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %169
  store i32 0, ptr %170, align 4, !tbaa !5
  %171 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3bfsi(i32 noundef %171)
  %172 = load i32, ptr %3, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %173
  %175 = load i32, ptr %13, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [400001 x i64], ptr %174, i64 0, i64 %176
  store i64 -1, ptr %177, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %247, %167
  %179 = load i32, ptr %18, align 4, !tbaa !5
  %180 = load i32, ptr @tot, align 4, !tbaa !5
  %181 = icmp sle i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %250

183:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %184 = load i32, ptr %18, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [400001 x i32], ptr @ord, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  store i32 %187, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %188 = load i32, ptr %19, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  store i32 %191, ptr %20, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %240, %183
  %193 = load i32, ptr %20, align 4, !tbaa !5
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %196, label %195

195:                                              ; preds = %192
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %246

196:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %197 = load i32, ptr %20, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %198
  %200 = getelementptr inbounds %struct.Edge, ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !9
  store i32 %201, ptr %21, align 4, !tbaa !5
  %202 = load i32, ptr %21, align 4, !tbaa !5
  %203 = load i32, ptr %19, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = icmp eq i32 %202, %206
  br i1 %207, label %215, label %208

208:                                              ; preds = %196
  %209 = load i32, ptr %20, align 4, !tbaa !5
  %210 = ashr i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %211
  %213 = load i8, ptr %212, align 1, !tbaa !11, !range !13, !noundef !14
  %214 = trunc i8 %213 to i1
  br i1 %214, label %215, label %216

215:                                              ; preds = %208, %196
  store i32 16, ptr %7, align 4
  br label %237

216:                                              ; preds = %208
  %217 = load i32, ptr %3, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %218
  %220 = load i32, ptr %19, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [400001 x i64], ptr %219, i64 0, i64 %221
  %223 = load i64, ptr %222, align 8, !tbaa !21
  %224 = load i32, ptr %20, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %225
  %227 = getelementptr inbounds %struct.Edge, ptr %226, i32 0, i32 2
  %228 = load i32, ptr %227, align 4, !tbaa !19
  %229 = sext i32 %228 to i64
  %230 = sub nsw i64 %223, %229
  %231 = load i32, ptr %3, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %232
  %234 = load i32, ptr %21, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [400001 x i64], ptr %233, i64 0, i64 %235
  store i64 %230, ptr %236, align 8, !tbaa !21
  store i32 0, ptr %7, align 4
  br label %237

237:                                              ; preds = %216, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  %238 = load i32, ptr %7, align 4
  switch i32 %238, label %344 [
    i32 0, label %239
    i32 16, label %240
  ]

239:                                              ; preds = %237
  br label %240

240:                                              ; preds = %239, %237
  %241 = load i32, ptr %20, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %242
  %244 = getelementptr inbounds %struct.Edge, ptr %243, i32 0, i32 0
  %245 = load i32, ptr %244, align 4, !tbaa !15
  store i32 %245, ptr %20, align 4, !tbaa !5
  br label %192, !llvm.loop !23

246:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %247

247:                                              ; preds = %246
  %248 = load i32, ptr %18, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %18, align 4, !tbaa !5
  br label %178, !llvm.loop !24

250:                                              ; preds = %182
  %251 = load i32, ptr %14, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %252
  store i32 0, ptr %253, align 4, !tbaa !5
  %254 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z3bfsi(i32 noundef %254)
  %255 = load i32, ptr %15, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  %257 = sext i32 %256 to i64
  %258 = load i32, ptr %3, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %259
  %261 = load i32, ptr %14, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [400001 x i64], ptr %260, i64 0, i64 %262
  store i64 %257, ptr %263, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 1, ptr %22, align 4, !tbaa !5
  br label %264

264:                                              ; preds = %333, %250
  %265 = load i32, ptr %22, align 4, !tbaa !5
  %266 = load i32, ptr @tot, align 4, !tbaa !5
  %267 = icmp sle i32 %265, %266
  br i1 %267, label %269, label %268

268:                                              ; preds = %264
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %336

269:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %270 = load i32, ptr %22, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [400001 x i32], ptr @ord, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  store i32 %273, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %274 = load i32, ptr %23, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  store i32 %277, ptr %24, align 4, !tbaa !5
  br label %278

278:                                              ; preds = %326, %269
  %279 = load i32, ptr %24, align 4, !tbaa !5
  %280 = icmp ne i32 %279, 0
  br i1 %280, label %282, label %281

281:                                              ; preds = %278
  store i32 20, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %332

282:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %283 = load i32, ptr %24, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %284
  %286 = getelementptr inbounds %struct.Edge, ptr %285, i32 0, i32 1
  %287 = load i32, ptr %286, align 4, !tbaa !9
  store i32 %287, ptr %25, align 4, !tbaa !5
  %288 = load i32, ptr %25, align 4, !tbaa !5
  %289 = load i32, ptr %23, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = icmp eq i32 %288, %292
  br i1 %293, label %301, label %294

294:                                              ; preds = %282
  %295 = load i32, ptr %24, align 4, !tbaa !5
  %296 = ashr i32 %295, 1
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %297
  %299 = load i8, ptr %298, align 1, !tbaa !11, !range !13, !noundef !14
  %300 = trunc i8 %299 to i1
  br i1 %300, label %301, label %302

301:                                              ; preds = %294, %282
  store i32 22, ptr %7, align 4
  br label %323

302:                                              ; preds = %294
  %303 = load i32, ptr %3, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %304
  %306 = load i32, ptr %23, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [400001 x i64], ptr %305, i64 0, i64 %307
  %309 = load i64, ptr %308, align 8, !tbaa !21
  %310 = load i32, ptr %24, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %311
  %313 = getelementptr inbounds %struct.Edge, ptr %312, i32 0, i32 2
  %314 = load i32, ptr %313, align 4, !tbaa !19
  %315 = sext i32 %314 to i64
  %316 = add nsw i64 %309, %315
  %317 = load i32, ptr %3, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %318
  %320 = load i32, ptr %25, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [400001 x i64], ptr %319, i64 0, i64 %321
  store i64 %316, ptr %322, align 8, !tbaa !21
  store i32 0, ptr %7, align 4
  br label %323

323:                                              ; preds = %302, %301
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  %324 = load i32, ptr %7, align 4
  switch i32 %324, label %344 [
    i32 0, label %325
    i32 22, label %326
  ]

325:                                              ; preds = %323
  br label %326

326:                                              ; preds = %325, %323
  %327 = load i32, ptr %24, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %328
  %330 = getelementptr inbounds %struct.Edge, ptr %329, i32 0, i32 0
  %331 = load i32, ptr %330, align 4, !tbaa !15
  store i32 %331, ptr %24, align 4, !tbaa !5
  br label %278, !llvm.loop !25

332:                                              ; preds = %281
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %333

333:                                              ; preds = %332
  %334 = load i32, ptr %22, align 4, !tbaa !5
  %335 = add nsw i32 %334, 1
  store i32 %335, ptr %22, align 4, !tbaa !5
  br label %264, !llvm.loop !26

336:                                              ; preds = %268
  %337 = load i32, ptr %3, align 4, !tbaa !5
  %338 = add nsw i32 %337, 1
  %339 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z10tree_buildii(i32 noundef %338, i32 noundef %339)
  %340 = load i32, ptr %3, align 4, !tbaa !5
  %341 = add nsw i32 %340, 1
  %342 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z10tree_buildii(i32 noundef %341, i32 noundef %342)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %343

343:                                              ; preds = %336, %32
  ret void

344:                                              ; preds = %323, %237, %92
  unreachable
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { noreturn 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 #4 = { 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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }

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

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


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

@tot = external dso_local local_unnamed_addr global i32, align 4
@lnk = external dso_local local_unnamed_addr global [400001 x i32], align 16
@ord = external dso_local local_unnamed_addr global [400001 x i32], align 16
@fa = external dso_local local_unnamed_addr global [400001 x i32], align 16
@e = external dso_local local_unnamed_addr global [800003 x %struct.Edge], align 16
@ban = external dso_local local_unnamed_addr global [400001 x i8], align 16
@dis = external dso_local local_unnamed_addr global [31 x [400001 x i64]], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._Z10tree_buildii = external hidden unnamed_addr constant [26 x i8], align 1
@_ZZ10tree_buildiiE2sz = external hidden global [400001 x i32], align 16

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z10tree_buildii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = sext i32 %1 to i64
  %5 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %4
  store i32 0, ptr %5, align 4, !tbaa !5
  tail call void @_Z3bfsi(i32 noundef %1)
  %6 = load i32, ptr @tot, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %129, label %8

8:                                                ; preds = %2
  %9 = icmp slt i32 %0, 31
  br i1 %9, label %.preheader, label %12

.preheader:                                       ; preds = %8
  %10 = icmp sgt i32 %6, 1
  br i1 %10, label %.lr.ph109.preheader, label %._crit_edge110

.lr.ph109.preheader:                              ; preds = %.preheader
  %11 = zext nneg i32 %6 to i64
  br label %.lr.ph109

12:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, i32 noundef 70, ptr noundef nonnull @__PRETTY_FUNCTION__._Z10tree_buildii) #5
  unreachable

._crit_edge110.loopexit:                          ; preds = %._crit_edge
  %.pre = sext i32 %spec.select100 to i64
  br label %._crit_edge110

._crit_edge110:                                   ; preds = %._crit_edge110.loopexit, %.preheader
  %.pre-phi = phi i64 [ %.pre, %._crit_edge110.loopexit ], [ %4, %.preheader ]
  %.0.lcssa = phi i32 [ %spec.select100, %._crit_edge110.loopexit ], [ %1, %.preheader ]
  %13 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %.pre-phi
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %15
  br label %51

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %._crit_edge
  %indvars.iv = phi i64 [ %11, %.lr.ph109.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.0108 = phi i32 [ %1, %.lr.ph109.preheader ], [ %spec.select100, %._crit_edge ]
  %.077107 = phi i32 [ %6, %.lr.ph109.preheader ], [ %spec.select, %._crit_edge ]
  %17 = getelementptr inbounds [400001 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %19
  store i32 1, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %19
  %.084103 = load i32, ptr %21, align 4, !tbaa !5
  %.not99104 = icmp eq i32 %.084103, 0
  br i1 %.not99104, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph109
  %22 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %19
  %23 = load i32, ptr %22, align 4, !tbaa !5
  br label %31

._crit_edge:                                      ; preds = %49, %.lr.ph109
  %24 = phi i32 [ 1, %.lr.ph109 ], [ %50, %49 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = sub nsw i32 %25, %24
  store i32 %26, ptr %3, align 4, !tbaa !5
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %28 = load i32, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %29 = icmp slt i32 %28, %.077107
  %spec.select = call i32 @llvm.smin.i32(i32 %28, i32 %.077107)
  %spec.select100 = select i1 %29, i32 %18, i32 %.0108
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %30 = icmp sgt i64 %indvars.iv, 2
  br i1 %30, label %.lr.ph109, label %._crit_edge110.loopexit, !llvm.loop !9

31:                                               ; preds = %.lr.ph, %49
  %32 = phi i32 [ 1, %.lr.ph ], [ %50, %49 ]
  %.084105 = phi i32 [ %.084103, %.lr.ph ], [ %.084, %49 ]
  %33 = sext i32 %.084105 to i64
  %34 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %33
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = icmp eq i32 %36, %23
  br i1 %37, label %49, label %38

38:                                               ; preds = %31
  %39 = ashr i32 %.084105, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !13, !range !15, !noundef !16
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %49, label %44

44:                                               ; preds = %38
  %45 = sext i32 %36 to i64
  %46 = getelementptr inbounds [400001 x i32], ptr @_ZZ10tree_buildiiE2sz, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %32, %47
  store i32 %48, ptr %20, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %31, %38, %44
  %50 = phi i32 [ %32, %31 ], [ %32, %38 ], [ %48, %44 ]
  %.084 = load i32, ptr %34, align 4, !tbaa !5
  %.not99 = icmp eq i32 %.084, 0
  br i1 %.not99, label %._crit_edge, label %31, !llvm.loop !17

51:                                               ; preds = %52, %._crit_edge110
  %.085.in = phi ptr [ %16, %._crit_edge110 ], [ %54, %52 ]
  %.085 = load i32, ptr %.085.in, align 4, !tbaa !5
  %.not = icmp eq i32 %.085, 0
  br i1 %.not, label %.loopexit, label %52

52:                                               ; preds = %51
  %53 = sext i32 %.085 to i64
  %54 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %53
  %55 = getelementptr inbounds i8, ptr %54, i64 4
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %.not94 = icmp eq i32 %56, %.0.lcssa
  br i1 %.not94, label %.thread, label %51

.thread:                                          ; preds = %52
  %57 = getelementptr inbounds i8, ptr %54, i64 8
  %58 = load i32, ptr %57, align 4, !tbaa !18
  %59 = ashr i32 %.085, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %60
  store i8 1, ptr %61, align 1, !tbaa !13
  %62 = add nsw i32 %58, 1
  %63 = sext i32 %62 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %51, %.thread
  %.2 = phi i64 [ %63, %.thread ], [ 0, %51 ]
  %64 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %15
  store i32 0, ptr %64, align 4, !tbaa !5
  call void @_Z3bfsi(i32 noundef %14)
  %65 = sext i32 %0 to i64
  %66 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %65, i64 %15
  store i64 -1, ptr %66, align 8, !tbaa !19
  %67 = load i32, ptr @tot, align 4, !tbaa !5
  %.not95117 = icmp slt i32 %67, 1
  br i1 %.not95117, label %._crit_edge121, label %.lr.ph120.preheader

.lr.ph120.preheader:                              ; preds = %.loopexit
  %68 = add nuw i32 %67, 1
  %wide.trip.count = zext i32 %68 to i64
  br label %.lr.ph120

._crit_edge121:                                   ; preds = %._crit_edge116, %.loopexit
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @_Z3bfsi(i32 noundef %.0.lcssa)
  %69 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %65, i64 %.pre-phi
  store i64 %.2, ptr %69, align 8, !tbaa !19
  %70 = load i32, ptr @tot, align 4, !tbaa !5
  %.not96128 = icmp slt i32 %70, 1
  br i1 %.not96128, label %._crit_edge132, label %.lr.ph131.preheader

.lr.ph131.preheader:                              ; preds = %._crit_edge121
  %71 = add nuw i32 %70, 1
  %wide.trip.count141 = zext i32 %71 to i64
  br label %.lr.ph131

.lr.ph120:                                        ; preds = %.lr.ph120.preheader, %._crit_edge116
  %indvars.iv135 = phi i64 [ 1, %.lr.ph120.preheader ], [ %indvars.iv.next136, %._crit_edge116 ]
  %72 = getelementptr inbounds [400001 x i32], ptr @ord, i64 0, i64 %indvars.iv135
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %74
  %.081111 = load i32, ptr %75, align 4, !tbaa !5
  %.not98112 = icmp eq i32 %.081111, 0
  br i1 %.not98112, label %._crit_edge116, label %.lr.ph115

.lr.ph115:                                        ; preds = %.lr.ph120
  %76 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %74
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %65, i64 %74
  br label %79

._crit_edge116:                                   ; preds = %99, %.lr.ph120
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge121, label %.lr.ph120, !llvm.loop !21

79:                                               ; preds = %.lr.ph115, %99
  %.081113 = phi i32 [ %.081111, %.lr.ph115 ], [ %.081, %99 ]
  %80 = sext i32 %.081113 to i64
  %81 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %80
  %82 = getelementptr inbounds i8, ptr %81, i64 4
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = icmp eq i32 %83, %77
  br i1 %84, label %99, label %85

85:                                               ; preds = %79
  %86 = ashr i32 %.081113, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %87
  %89 = load i8, ptr %88, align 1, !tbaa !13, !range !15, !noundef !16
  %90 = trunc nuw i8 %89 to i1
  br i1 %90, label %99, label %91

91:                                               ; preds = %85
  %92 = load i64, ptr %78, align 8, !tbaa !19
  %93 = getelementptr inbounds i8, ptr %81, i64 8
  %94 = load i32, ptr %93, align 4, !tbaa !18
  %95 = sext i32 %94 to i64
  %96 = sub nsw i64 %92, %95
  %97 = sext i32 %83 to i64
  %98 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %65, i64 %97
  store i64 %96, ptr %98, align 8, !tbaa !19
  br label %99

99:                                               ; preds = %79, %85, %91
  %.081 = load i32, ptr %81, align 4, !tbaa !5
  %.not98 = icmp eq i32 %.081, 0
  br i1 %.not98, label %._crit_edge116, label %79, !llvm.loop !22

._crit_edge132:                                   ; preds = %._crit_edge127, %._crit_edge121
  %100 = add nsw i32 %0, 1
  call void @_Z10tree_buildii(i32 noundef %100, i32 noundef %14)
  call void @_Z10tree_buildii(i32 noundef %100, i32 noundef %.0.lcssa)
  br label %129

.lr.ph131:                                        ; preds = %.lr.ph131.preheader, %._crit_edge127
  %indvars.iv138 = phi i64 [ 1, %.lr.ph131.preheader ], [ %indvars.iv.next139, %._crit_edge127 ]
  %101 = getelementptr inbounds [400001 x i32], ptr @ord, i64 0, i64 %indvars.iv138
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [400001 x i32], ptr @lnk, i64 0, i64 %103
  %.076122 = load i32, ptr %104, align 4, !tbaa !5
  %.not97123 = icmp eq i32 %.076122, 0
  br i1 %.not97123, label %._crit_edge127, label %.lr.ph126

.lr.ph126:                                        ; preds = %.lr.ph131
  %105 = getelementptr inbounds [400001 x i32], ptr @fa, i64 0, i64 %103
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %65, i64 %103
  br label %108

._crit_edge127:                                   ; preds = %128, %.lr.ph131
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %exitcond142.not = icmp eq i64 %indvars.iv.next139, %wide.trip.count141
  br i1 %exitcond142.not, label %._crit_edge132, label %.lr.ph131, !llvm.loop !23

108:                                              ; preds = %.lr.ph126, %128
  %.076124 = phi i32 [ %.076122, %.lr.ph126 ], [ %.076, %128 ]
  %109 = sext i32 %.076124 to i64
  %110 = getelementptr inbounds [800003 x %struct.Edge], ptr @e, i64 0, i64 %109
  %111 = getelementptr inbounds i8, ptr %110, i64 4
  %112 = load i32, ptr %111, align 4, !tbaa !11
  %113 = icmp eq i32 %112, %106
  br i1 %113, label %128, label %114

114:                                              ; preds = %108
  %115 = ashr i32 %.076124, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [400001 x i8], ptr @ban, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !13, !range !15, !noundef !16
  %119 = trunc nuw i8 %118 to i1
  br i1 %119, label %128, label %120

120:                                              ; preds = %114
  %121 = load i64, ptr %107, align 8, !tbaa !19
  %122 = getelementptr inbounds i8, ptr %110, i64 8
  %123 = load i32, ptr %122, align 4, !tbaa !18
  %124 = sext i32 %123 to i64
  %125 = add nsw i64 %121, %124
  %126 = sext i32 %112 to i64
  %127 = getelementptr inbounds [31 x [400001 x i64]], ptr @dis, i64 0, i64 %65, i64 %126
  store i64 %125, ptr %127, align 8, !tbaa !19
  br label %128

128:                                              ; preds = %108, %114, %120
  %.076 = load i32, ptr %110, align 4, !tbaa !5
  %.not97 = icmp eq i32 %.076, 0
  br i1 %.not97, label %._crit_edge127, label %108, !llvm.loop !24

129:                                              ; preds = %2, %._crit_edge132
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

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

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

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


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