; LLVM IR from tangjz/acm-icpc :: 51nod (2004)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@a = external dso_local global [50001 x i32], align 16
@pre = external dso_local global [50001 x i32], align 16
@suf = external dso_local global [50001 x i32], align 16
@fa = external dso_local global [50001 x i32], align 16
@ord = external dso_local global [50001 x i32], align 16
@rnk = external dso_local global [50001 x i32], align 16
@lnk = external dso_local global [50001 x i32], align 16
@dsu = external dso_local global [50001 x i32], align 16
@pos = external dso_local global [50001 x i32], align 16
@idom = external dso_local global [50001 x i32], align 16
@sdom = external dso_local global [50001 x i32], align 16
@e = external dso_local global [300003 x %struct.Edge], align 16
@qtim = external dso_local global i32, align 4
@qtot = external dso_local global i32, align 4
@que = external dso_local global [1700017 x %struct.Operation], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8dsu_findi(i32 noundef) #1

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5queryii(i32 noundef, i32 noundef) #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Edge, align 4
  %7 = alloca %struct.Edge, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.Edge, 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 %struct.Edge, align 4
  %19 = alloca [3 x i8], align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %56, %0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [50001 x i32], ptr @rnk, i64 0, i64 %31
  store i32 -1, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %34
  store i32 -1, ptr %35, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %37
  store i32 -1, ptr %38, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50001 x i32], ptr @pre, i64 0, i64 %40
  store i32 -1, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %44
  store i32 %42, ptr %45, align 4, !tbaa !5
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %47
  store i32 %42, ptr %48, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [50001 x i32], ptr @dsu, i64 0, i64 %50
  store i32 %42, ptr %51, align 4, !tbaa !5
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr @a, i64 %53
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %54)
  br label %56

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

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

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

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

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %67 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [50001 x i32], ptr @pre, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %67, align 4, !tbaa !11
  %73 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %5, align 4, !tbaa !5
  store i32 %75, ptr %73, align 4, !tbaa !13
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = shl i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %79, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = shl i32 %80, 1
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50001 x i32], ptr @pre, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %85 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 0
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  store i32 %89, ptr %85, align 4, !tbaa !11
  %90 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 1
  %91 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %91, ptr %90, align 4, !tbaa !13
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = shl i32 %92, 1
  %94 = or i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %95
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %96, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = shl i32 %97, 1
  %99 = or i32 %98, 1
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %101
  store i32 %99, ptr %102, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %103

103:                                              ; preds = %65
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %3, align 4, !tbaa !5
  br label %60, !llvm.loop !15

106:                                              ; preds = %64
  %107 = load i32, ptr @m, align 4, !tbaa !5
  %108 = shl i32 %107, 1
  store i32 %108, ptr @m, align 4, !tbaa !5
  store i32 -1, ptr @fa, align 16, !tbaa !5
  call void @_Z3dfsi(i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 1
  store i32 %110, ptr %8, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %276, %106
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = icmp sge i32 %112, 1
  br i1 %113, label %115, label %114

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

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  store i32 %119, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  store i32 %123, ptr %11, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %167, %115
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = icmp ne i32 %125, -1
  br i1 %126, label %128, label %127

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

128:                                              ; preds = %124
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %130
  %132 = getelementptr inbounds %struct.Edge, ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !13
  %134 = call noundef i32 @_Z8dsu_findi(i32 noundef %133)
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.Edge, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !13
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = call noundef zeroext i1 @_Z3cmpii(i32 noundef %145, i32 noundef %149)
  br i1 %150, label %151, label %166

151:                                              ; preds = %128
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %153
  %155 = getelementptr inbounds %struct.Edge, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !13
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %164
  store i32 %162, ptr %165, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %151, %128
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %11, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %169
  %171 = getelementptr inbounds %struct.Edge, ptr %170, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !11
  store i32 %172, ptr %11, align 4, !tbaa !5
  br label %124, !llvm.loop !16

173:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %174 = getelementptr inbounds %struct.Edge, ptr %12, i32 0, i32 0
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  store i32 %181, ptr %174, align 4, !tbaa !11
  %182 = getelementptr inbounds %struct.Edge, ptr %12, i32 0, i32 1
  %183 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %183, ptr %182, align 4, !tbaa !13
  %184 = load i32, ptr @m, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %185
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %186, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %187 = load i32, ptr @m, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr @m, align 4, !tbaa !5
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %193
  store i32 %187, ptr %194, align 4, !tbaa !5
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [50001 x i32], ptr @fa, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [50001 x i32], ptr @dsu, i64 0, i64 %200
  store i32 %198, ptr %201, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %202 = load i32, ptr %10, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [50001 x i32], ptr @fa, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  store i32 %208, ptr %13, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %263, %173
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = icmp ne i32 %210, -1
  br i1 %211, label %213, label %212

212:                                              ; preds = %209
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %269

213:                                              ; preds = %209
  %214 = load i32, ptr %13, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %215
  %217 = getelementptr inbounds %struct.Edge, ptr %216, i32 0, i32 1
  %218 = load i32, ptr %217, align 4, !tbaa !13
  %219 = call noundef i32 @_Z8dsu_findi(i32 noundef %218)
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %221
  %223 = getelementptr inbounds %struct.Edge, ptr %222, i32 0, i32 1
  %224 = load i32, ptr %223, align 4, !tbaa !13
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = load i32, ptr %13, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %232
  %234 = getelementptr inbounds %struct.Edge, ptr %233, i32 0, i32 1
  %235 = load i32, ptr %234, align 4, !tbaa !13
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = icmp eq i32 %230, %238
  br i1 %239, label %240, label %245

240:                                              ; preds = %213
  %241 = load i32, ptr %10, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [50001 x i32], ptr @fa, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  br label %254

245:                                              ; preds = %213
  %246 = load i32, ptr %13, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %247
  %249 = getelementptr inbounds %struct.Edge, ptr %248, i32 0, i32 1
  %250 = load i32, ptr %249, align 4, !tbaa !13
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !5
  br label %254

254:                                              ; preds = %245, %240
  %255 = phi i32 [ %244, %240 ], [ %253, %245 ]
  %256 = load i32, ptr %13, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %257
  %259 = getelementptr inbounds %struct.Edge, ptr %258, i32 0, i32 1
  %260 = load i32, ptr %259, align 4, !tbaa !13
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %261
  store i32 %255, ptr %262, align 4, !tbaa !5
  br label %263

263:                                              ; preds = %254
  %264 = load i32, ptr %13, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %265
  %267 = getelementptr inbounds %struct.Edge, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 8, !tbaa !11
  store i32 %268, ptr %13, align 4, !tbaa !5
  br label %209, !llvm.loop !17

269:                                              ; preds = %212
  %270 = load i32, ptr %10, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [50001 x i32], ptr @fa, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %274
  store i32 -1, ptr %275, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %276

276:                                              ; preds = %269
  %277 = load i32, ptr %8, align 4, !tbaa !5
  %278 = add nsw i32 %277, -1
  store i32 %278, ptr %8, align 4, !tbaa !5
  br label %111, !llvm.loop !18

279:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %280

280:                                              ; preds = %317, %279
  %281 = load i32, ptr %14, align 4, !tbaa !5
  %282 = load i32, ptr @n, align 4, !tbaa !5
  %283 = icmp slt i32 %281, %282
  br i1 %283, label %285, label %284

284:                                              ; preds = %280
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %320

285:                                              ; preds = %280
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %286 = load i32, ptr %14, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  store i32 %289, ptr %15, align 4, !tbaa !5
  %290 = load i32, ptr %15, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !5
  %294 = load i32, ptr %15, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %295
  %297 = load i32, ptr %296, align 4, !tbaa !5
  %298 = icmp eq i32 %293, %297
  br i1 %298, label %299, label %304

299:                                              ; preds = %285
  %300 = load i32, ptr %15, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !5
  br label %312

304:                                              ; preds = %285
  %305 = load i32, ptr %15, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !5
  br label %312

312:                                              ; preds = %304, %299
  %313 = phi i32 [ %303, %299 ], [ %311, %304 ]
  %314 = load i32, ptr %15, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %315
  store i32 %313, ptr %316, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %317

317:                                              ; preds = %312
  %318 = load i32, ptr %14, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %14, align 4, !tbaa !5
  br label %280, !llvm.loop !19

320:                                              ; preds = %284
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %321

321:                                              ; preds = %363, %320
  %322 = load i32, ptr %16, align 4, !tbaa !5
  %323 = load i32, ptr @n, align 4, !tbaa !5
  %324 = icmp slt i32 %322, %323
  br i1 %324, label %326, label %325

325:                                              ; preds = %321
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %366

326:                                              ; preds = %321
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %327 = load i32, ptr %16, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %328
  %330 = load i32, ptr %329, align 4, !tbaa !5
  store i32 %330, ptr %17, align 4, !tbaa !5
  %331 = load i32, ptr %17, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %332
  store i32 -1, ptr %333, align 4, !tbaa !5
  %334 = load i32, ptr %17, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %335
  %337 = load i32, ptr %336, align 4, !tbaa !5
  %338 = load i32, ptr %17, align 4, !tbaa !5
  %339 = call noundef zeroext i1 @_Z3cmpii(i32 noundef %337, i32 noundef %338)
  br i1 %339, label %340, label %362

340:                                              ; preds = %326
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %341 = getelementptr inbounds %struct.Edge, ptr %18, i32 0, i32 0
  %342 = load i32, ptr %17, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %343
  %345 = load i32, ptr %344, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !5
  store i32 %348, ptr %341, align 4, !tbaa !11
  %349 = getelementptr inbounds %struct.Edge, ptr %18, i32 0, i32 1
  %350 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %350, ptr %349, align 4, !tbaa !13
  %351 = load i32, ptr @m, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %352
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %353, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %354 = load i32, ptr @m, align 4, !tbaa !5
  %355 = add nsw i32 %354, 1
  store i32 %355, ptr @m, align 4, !tbaa !5
  %356 = load i32, ptr %17, align 4, !tbaa !5
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %360
  store i32 %354, ptr %361, align 4, !tbaa !5
  br label %362

362:                                              ; preds = %340, %326
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %363

363:                                              ; preds = %362
  %364 = load i32, ptr %16, align 4, !tbaa !5
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %16, align 4, !tbaa !5
  br label %321, !llvm.loop !20

366:                                              ; preds = %325
  call void @_Z3bfsi(i32 noundef 0)
  %367 = load i32, ptr @n, align 4, !tbaa !5
  %368 = sub nsw i32 %367, 1
  call void @_Z9seg_buildii(i32 noundef 0, i32 noundef %368)
  %369 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @tot)
  br label %370

370:                                              ; preds = %450, %366
  %371 = load i32, ptr @tot, align 4, !tbaa !5
  %372 = add nsw i32 %371, -1
  store i32 %372, ptr @tot, align 4, !tbaa !5
  %373 = icmp ne i32 %371, 0
  br i1 %373, label %374, label %451

374:                                              ; preds = %370
  call void @llvm.lifetime.start.p0(i64 3, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %375 = getelementptr inbounds [3 x i8], ptr %19, i64 0, i64 0
  %376 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %375, ptr noundef %20)
  %377 = getelementptr inbounds [3 x i8], ptr %19, i64 0, i64 0
  %378 = load i8, ptr %377, align 1, !tbaa !21
  %379 = sext i8 %378 to i32
  %380 = icmp eq i32 %379, 67
  br i1 %380, label %381, label %389

381:                                              ; preds = %374
  %382 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %21, ptr noundef %22)
  %383 = load i32, ptr %20, align 4, !tbaa !5
  %384 = load i32, ptr %21, align 4, !tbaa !5
  %385 = add nsw i32 %384, -1
  store i32 %385, ptr %21, align 4, !tbaa !5
  %386 = load i32, ptr %22, align 4, !tbaa !5
  call void @_Z6updateiii(i32 noundef %383, i32 noundef %385, i32 noundef %386)
  %387 = load i32, ptr @qtim, align 4, !tbaa !5
  %388 = add nsw i32 %387, 1
  store i32 %388, ptr @qtim, align 4, !tbaa !5
  br label %450

389:                                              ; preds = %374
  %390 = getelementptr inbounds [3 x i8], ptr %19, i64 0, i64 0
  %391 = load i8, ptr %390, align 1, !tbaa !21
  %392 = sext i8 %391 to i32
  %393 = icmp eq i32 %392, 81
  br i1 %393, label %394, label %401

394:                                              ; preds = %389
  %395 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %21)
  %396 = load i32, ptr %20, align 4, !tbaa !5
  %397 = load i32, ptr %21, align 4, !tbaa !5
  %398 = add nsw i32 %397, -1
  store i32 %398, ptr %21, align 4, !tbaa !5
  %399 = call noundef i32 @_Z5queryii(i32 noundef %396, i32 noundef %398)
  %400 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %399)
  br label %449

401:                                              ; preds = %389
  %402 = load i32, ptr %20, align 4, !tbaa !5
  %403 = load i32, ptr @qtim, align 4, !tbaa !5
  %404 = sub nsw i32 %403, %402
  store i32 %404, ptr @qtim, align 4, !tbaa !5
  %405 = icmp slt i32 %404, 0
  br i1 %405, label %406, label %407

406:                                              ; preds = %401
  store i32 0, ptr @qtim, align 4, !tbaa !5
  br label %407

407:                                              ; preds = %406, %401
  %408 = phi i1 [ false, %401 ], [ false, %406 ]
  br label %409

409:                                              ; preds = %445, %407
  %410 = load i32, ptr @qtot, align 4, !tbaa !5
  %411 = icmp ne i32 %410, 0
  br i1 %411, label %412, label %421

412:                                              ; preds = %409
  %413 = load i32, ptr @qtot, align 4, !tbaa !5
  %414 = sub nsw i32 %413, 1
  %415 = sext i32 %414 to i64
  %416 = getelementptr inbounds [1700017 x %struct.Operation], ptr @que, i64 0, i64 %415
  %417 = getelementptr inbounds %struct.Operation, ptr %416, i32 0, i32 0
  %418 = load i32, ptr %417, align 16, !tbaa !22
  %419 = load i32, ptr @qtim, align 4, !tbaa !5
  %420 = icmp sge i32 %418, %419
  br label %421

421:                                              ; preds = %412, %409
  %422 = phi i1 [ false, %409 ], [ %420, %412 ]
  br i1 %422, label %423, label %448

423:                                              ; preds = %421
  %424 = load i32, ptr @n, align 4, !tbaa !5
  %425 = sub nsw i32 %424, 1
  %426 = load i32, ptr @qtot, align 4, !tbaa !5
  %427 = sub nsw i32 %426, 1
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds [1700017 x %struct.Operation], ptr @que, i64 0, i64 %428
  %430 = getelementptr inbounds %struct.Operation, ptr %429, i32 0, i32 1
  %431 = load i32, ptr %430, align 4, !tbaa !24
  %432 = load i32, ptr @qtot, align 4, !tbaa !5
  %433 = sub nsw i32 %432, 1
  %434 = sext i32 %433 to i64
  %435 = getelementptr inbounds [1700017 x %struct.Operation], ptr @que, i64 0, i64 %434
  %436 = getelementptr inbounds %struct.Operation, ptr %435, i32 0, i32 2
  %437 = load i32, ptr %436, align 8, !tbaa !25
  %438 = load i32, ptr @qtot, align 4, !tbaa !5
  %439 = sub nsw i32 %438, 1
  %440 = sext i32 %439 to i64
  %441 = getelementptr inbounds [1700017 x %struct.Operation], ptr @que, i64 0, i64 %440
  %442 = getelementptr inbounds %struct.Operation, ptr %441, i32 0, i32 3
  %443 = load i32, ptr %442, align 4, !tbaa !26
  %444 = sub nsw i32 0, %443
  call void @_Z7seg_updiiiii(i32 noundef 0, i32 noundef %425, i32 noundef %431, i32 noundef %437, i32 noundef %444)
  br label %445

445:                                              ; preds = %423
  %446 = load i32, ptr @qtot, align 4, !tbaa !5
  %447 = add nsw i32 %446, -1
  store i32 %447, ptr @qtot, align 4, !tbaa !5
  br label %409, !llvm.loop !27

448:                                              ; preds = %421
  br label %449

449:                                              ; preds = %448, %394
  br label %450

450:                                              ; preds = %449, %381
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %19) #6
  br label %370, !llvm.loop !28

451:                                              ; preds = %370
  ret i32 0
}

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

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 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 #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 0}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTS9Operation", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!24 = !{!23, !6, i64 4}
!25 = !{!23, !6, i64 8}
!26 = !{!23, !6, i64 12}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Edge = type { i32, i32 }
%struct.Operation = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@a = external dso_local global [50001 x i32], align 16
@pre = external dso_local local_unnamed_addr global [50001 x i32], align 16
@suf = external dso_local local_unnamed_addr global [50001 x i32], align 16
@fa = external dso_local local_unnamed_addr global [50001 x i32], align 16
@ord = external dso_local local_unnamed_addr global [50001 x i32], align 16
@rnk = external dso_local local_unnamed_addr global [50001 x i32], align 16
@lnk = external dso_local local_unnamed_addr global [50001 x i32], align 16
@dsu = external dso_local local_unnamed_addr global [50001 x i32], align 16
@pos = external dso_local local_unnamed_addr global [50001 x i32], align 16
@idom = external dso_local local_unnamed_addr global [50001 x i32], align 16
@sdom = external dso_local local_unnamed_addr global [50001 x i32], align 16
@e = external dso_local local_unnamed_addr global [300003 x %struct.Edge], align 16
@qtim = external dso_local local_unnamed_addr global i32, align 4
@qtot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [1700017 x %struct.Operation], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5queryii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

.preheader80:                                     ; preds = %.lr.ph, %0
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph83, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [50001 x i32], ptr @rnk, i64 0, i64 %indvars.iv
  store i32 -1, ptr %12, align 4, !tbaa !5
  %13 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %indvars.iv
  store i32 -1, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %indvars.iv
  store i32 -1, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds [50001 x i32], ptr @pre, i64 0, i64 %indvars.iv
  store i32 -1, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %indvars.iv
  store i32 %17, ptr %18, align 4, !tbaa !5
  %19 = getelementptr inbounds [50001 x i32], ptr @dsu, i64 0, i64 %indvars.iv
  store i32 %17, ptr %19, align 4, !tbaa !5
  %20 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %.preheader80, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph83, %.preheader80
  %.lcssa = phi i32 [ %10, %.preheader80 ], [ %48, %.lr.ph83 ]
  %25 = shl i32 %.lcssa, 1
  store i32 %25, ptr @m, align 4, !tbaa !5
  store i32 -1, ptr @fa, align 16, !tbaa !5
  call void @_Z3dfsi(i32 noundef 0)
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 1
  br i1 %27, label %.lr.ph99.preheader, label %._crit_edge102

.lr.ph99.preheader:                               ; preds = %._crit_edge
  %28 = zext nneg i32 %26 to i64
  br label %.lr.ph99

.lr.ph83:                                         ; preds = %.preheader80, %.lr.ph83
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %.lr.ph83 ], [ 0, %.preheader80 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [50001 x i32], ptr @pre, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, -1
  %37 = shl nuw i64 %indvars.iv117, 1
  %38 = trunc nuw i64 %37 to i32
  %sext = shl i64 %indvars.iv117, 33
  %39 = ashr exact i64 %sext, 32
  %40 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %39
  store i32 %34, ptr %40, align 16, !tbaa !5
  %.sroa.448.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 4
  store i32 %36, ptr %.sroa.448.0..sroa_idx, align 4, !tbaa !5
  store i32 %38, ptr %33, align 4, !tbaa !5
  %41 = sext i32 %36 to i64
  %42 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = trunc i64 %37 to i32
  %45 = or disjoint i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %46
  store i32 %43, ptr %47, align 8, !tbaa !5
  %.sroa.446.0..sroa_idx = getelementptr inbounds i8, ptr %47, i64 4
  store i32 %31, ptr %.sroa.446.0..sroa_idx, align 4, !tbaa !5
  store i32 %45, ptr %42, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next118, %49
  br i1 %50, label %.lr.ph83, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge95
  %.pre129 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp sgt i32 %.pre129, 1
  br i1 %51, label %.lr.ph101.preheader, label %._crit_edge102

.lr.ph101.preheader:                              ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %.pre129 to i64
  %52 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %52, 1
  %53 = icmp eq i32 %.pre129, 2
  br i1 %53, label %._crit_edge102.loopexit.unr-lcssa, label %.lr.ph101.preheader.new

.lr.ph101.preheader.new:                          ; preds = %.lr.ph101.preheader
  %unroll_iter = and i64 %52, -2
  br label %.lr.ph101

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %._crit_edge95
  %indvars.iv120 = phi i64 [ %28, %.lr.ph99.preheader ], [ %indvars.iv.next121, %._crit_edge95 ]
  %indvars.iv.next121 = add nsw i64 %indvars.iv120, -1
  %54 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv.next121
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [50001 x i32], ptr @suf, i64 0, i64 %56
  %.07184 = load i32, ptr %57, align 4, !tbaa !5
  %.not7885 = icmp eq i32 %.07184, -1
  br i1 %.not7885, label %._crit_edge89, label %.lr.ph88

.lr.ph88:                                         ; preds = %.lr.ph99
  %58 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %56
  br label %73

._crit_edge89:                                    ; preds = %96, %.lr.ph99
  %59 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %56
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %65
  store i32 %63, ptr %66, align 8, !tbaa !5
  %.sroa.425.0..sroa_idx = getelementptr inbounds i8, ptr %66, i64 4
  store i32 %55, ptr %.sroa.425.0..sroa_idx, align 4, !tbaa !5
  %67 = add nsw i32 %64, 1
  store i32 %67, ptr @m, align 4, !tbaa !5
  store i32 %64, ptr %62, align 4, !tbaa !5
  %68 = getelementptr inbounds [50001 x i32], ptr @fa, i64 0, i64 %56
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds [50001 x i32], ptr @dsu, i64 0, i64 %56
  store i32 %69, ptr %70, align 4, !tbaa !5
  %71 = sext i32 %69 to i64
  %72 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %71
  %.07090 = load i32, ptr %72, align 4, !tbaa !5
  %.not7991 = icmp eq i32 %.07090, -1
  br i1 %.not7991, label %._crit_edge95, label %.lr.ph94

73:                                               ; preds = %.lr.ph88, %96
  %.07186 = phi i32 [ %.07184, %.lr.ph88 ], [ %.071, %96 ]
  %74 = sext i32 %.07186 to i64
  %75 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %74
  %76 = getelementptr inbounds i8, ptr %75, i64 4
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = call noundef i32 @_Z8dsu_findi(i32 noundef %77)
  %79 = load i32, ptr %76, align 4, !tbaa !12
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr %58, align 4, !tbaa !5
  %87 = call noundef zeroext i1 @_Z3cmpii(i32 noundef %85, i32 noundef %86)
  br i1 %87, label %88, label %96

88:                                               ; preds = %73
  %89 = load i32, ptr %76, align 4, !tbaa !12
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %58, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %73, %88
  %.071 = load i32, ptr %75, align 8, !tbaa !5
  %.not78 = icmp eq i32 %.071, -1
  br i1 %.not78, label %._crit_edge89, label %73, !llvm.loop !14

._crit_edge95.loopexit:                           ; preds = %116
  %.pre = load i32, ptr %68, align 4, !tbaa !5
  %.pre130 = sext i32 %.pre to i64
  br label %._crit_edge95

._crit_edge95:                                    ; preds = %._crit_edge95.loopexit, %._crit_edge89
  %.pre-phi = phi i64 [ %.pre130, %._crit_edge95.loopexit ], [ %71, %._crit_edge89 ]
  %97 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %.pre-phi
  store i32 -1, ptr %97, align 4, !tbaa !5
  %98 = icmp sgt i64 %indvars.iv120, 2
  br i1 %98, label %.lr.ph99, label %.preheader, !llvm.loop !15

.lr.ph94:                                         ; preds = %._crit_edge89, %116
  %.07092 = phi i32 [ %.070, %116 ], [ %.07090, %._crit_edge89 ]
  %99 = sext i32 %.07092 to i64
  %100 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %99
  %101 = getelementptr inbounds i8, ptr %100, i64 4
  %102 = load i32, ptr %101, align 4, !tbaa !12
  %103 = call noundef i32 @_Z8dsu_findi(i32 noundef %102)
  %104 = load i32, ptr %101, align 4, !tbaa !12
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %105
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = icmp eq i32 %110, %112
  br i1 %113, label %114, label %116

114:                                              ; preds = %.lr.ph94
  %115 = load i32, ptr %68, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %.lr.ph94, %114
  %117 = phi i32 [ %115, %114 ], [ %107, %.lr.ph94 ]
  %118 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %105
  store i32 %117, ptr %118, align 4, !tbaa !5
  %.070 = load i32, ptr %100, align 8, !tbaa !5
  %.not79 = icmp eq i32 %.070, -1
  br i1 %.not79, label %._crit_edge95.loopexit, label %.lr.ph94, !llvm.loop !16

._crit_edge102.loopexit.unr-lcssa:                ; preds = %159, %.lr.ph101.preheader
  %indvars.iv123.unr = phi i64 [ 1, %.lr.ph101.preheader ], [ %indvars.iv.next124.1, %159 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge102, label %.lr.ph101.epil

.lr.ph101.epil:                                   ; preds = %._crit_edge102.loopexit.unr-lcssa
  %119 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv123.unr
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %121
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = icmp eq i32 %123, %125
  br i1 %126, label %._crit_edge102.loopexit.epilog-lcssa, label %127

127:                                              ; preds = %.lr.ph101.epil
  %128 = sext i32 %123 to i64
  %129 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  br label %._crit_edge102.loopexit.epilog-lcssa

._crit_edge102.loopexit.epilog-lcssa:             ; preds = %127, %.lr.ph101.epil
  %131 = phi i32 [ %130, %127 ], [ %123, %.lr.ph101.epil ]
  store i32 %131, ptr %122, align 4, !tbaa !5
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge102.loopexit.epilog-lcssa, %._crit_edge102.loopexit.unr-lcssa, %._crit_edge, %.preheader
  %132 = phi i32 [ %.pre129, %.preheader ], [ %26, %._crit_edge ], [ %.pre129, %._crit_edge102.loopexit.unr-lcssa ], [ %.pre129, %._crit_edge102.loopexit.epilog-lcssa ]
  store i32 0, ptr @m, align 4, !tbaa !5
  %133 = icmp sgt i32 %132, 0
  br i1 %133, label %.lr.ph105, label %._crit_edge106

.lr.ph101:                                        ; preds = %159, %.lr.ph101.preheader.new
  %indvars.iv123 = phi i64 [ 1, %.lr.ph101.preheader.new ], [ %indvars.iv.next124.1, %159 ]
  %niter = phi i64 [ 0, %.lr.ph101.preheader.new ], [ %niter.next.1, %159 ]
  %134 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv123
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %136
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = icmp eq i32 %138, %140
  br i1 %141, label %.lr.ph101.1, label %142

142:                                              ; preds = %.lr.ph101
  %143 = sext i32 %138 to i64
  %144 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  br label %.lr.ph101.1

.lr.ph101.1:                                      ; preds = %.lr.ph101, %142
  %146 = phi i32 [ %145, %142 ], [ %138, %.lr.ph101 ]
  store i32 %146, ptr %137, align 4, !tbaa !5
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %147 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv.next124
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = getelementptr inbounds [50001 x i32], ptr @sdom, i64 0, i64 %149
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp eq i32 %151, %153
  br i1 %154, label %159, label %155

155:                                              ; preds = %.lr.ph101.1
  %156 = sext i32 %151 to i64
  %157 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %155, %.lr.ph101.1
  %160 = phi i32 [ %158, %155 ], [ %151, %.lr.ph101.1 ]
  store i32 %160, ptr %150, align 4, !tbaa !5
  %indvars.iv.next124.1 = add nuw nsw i64 %indvars.iv123, 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_edge102.loopexit.unr-lcssa, label %.lr.ph101, !llvm.loop !17

._crit_edge106:                                   ; preds = %182, %._crit_edge102
  call void @_Z3bfsi(i32 noundef 0)
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = add nsw i32 %161, -1
  call void @_Z9seg_buildii(i32 noundef 0, i32 noundef %162)
  %163 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @tot)
  %164 = load i32, ptr @tot, align 4, !tbaa !5
  %165 = add nsw i32 %164, -1
  store i32 %165, ptr @tot, align 4, !tbaa !5
  %.not111 = icmp eq i32 %164, 0
  br i1 %.not111, label %._crit_edge114, label %.lr.ph113

.lr.ph105:                                        ; preds = %._crit_edge102, %182
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %182 ], [ 0, %._crit_edge102 ]
  %166 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv126
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %168
  store i32 -1, ptr %169, align 4, !tbaa !5
  %170 = getelementptr inbounds [50001 x i32], ptr @idom, i64 0, i64 %168
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = call noundef zeroext i1 @_Z3cmpii(i32 noundef %171, i32 noundef %167)
  br i1 %172, label %173, label %182

173:                                              ; preds = %.lr.ph105
  %174 = load i32, ptr %170, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [50001 x i32], ptr @lnk, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = load i32, ptr @m, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [300003 x %struct.Edge], ptr @e, i64 0, i64 %179
  store i32 %177, ptr %180, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %180, i64 4
  store i32 %167, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %181 = add nsw i32 %178, 1
  store i32 %181, ptr @m, align 4, !tbaa !5
  store i32 %178, ptr %176, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %173, %.lr.ph105
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %183 = load i32, ptr @n, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = icmp slt i64 %indvars.iv.next127, %184
  br i1 %185, label %.lr.ph105, label %._crit_edge106, !llvm.loop !18

.lr.ph113:                                        ; preds = %._crit_edge106, %.critedge
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %186 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %187 = load i8, ptr %3, align 1, !tbaa !19
  switch i8 %187, label %203 [
    i8 67, label %188
    i8 81, label %196
  ]

188:                                              ; preds = %.lr.ph113
  %189 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %190 = load i32, ptr %4, align 4, !tbaa !5
  %191 = load i32, ptr %5, align 4, !tbaa !5
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %5, align 4, !tbaa !5
  %193 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z6updateiii(i32 noundef %190, i32 noundef %192, i32 noundef %193)
  %194 = load i32, ptr @qtim, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr @qtim, align 4, !tbaa !5
  br label %.critedge

196:                                              ; preds = %.lr.ph113
  %197 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %198 = load i32, ptr %4, align 4, !tbaa !5
  %199 = load i32, ptr %5, align 4, !tbaa !5
  %200 = add nsw i32 %199, -1
  store i32 %200, ptr %5, align 4, !tbaa !5
  %201 = call noundef i32 @_Z5queryii(i32 noundef %198, i32 noundef %200)
  %202 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %201)
  br label %.critedge

203:                                              ; preds = %.lr.ph113
  %204 = load i32, ptr %4, align 4, !tbaa !5
  %205 = load i32, ptr @qtim, align 4, !tbaa !5
  %206 = sub nsw i32 %205, %204
  %spec.store.select = call i32 @llvm.smax.i32(i32 %206, i32 0)
  store i32 %spec.store.select, ptr @qtim, align 4
  %.pr = load i32, ptr @qtot, align 4, !tbaa !5
  %.not76107 = icmp eq i32 %.pr, 0
  br i1 %.not76107, label %.critedge, label %.lr.ph109

.lr.ph109:                                        ; preds = %203, %213
  %207 = phi i32 [ %224, %213 ], [ %.pr, %203 ]
  %208 = add nsw i32 %207, -1
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [1700017 x %struct.Operation], ptr @que, i64 0, i64 %209
  %211 = load i32, ptr %210, align 16, !tbaa !20
  %212 = load i32, ptr @qtim, align 4, !tbaa !5
  %.not77 = icmp slt i32 %211, %212
  br i1 %.not77, label %.critedge, label %213

213:                                              ; preds = %.lr.ph109
  %214 = load i32, ptr @n, align 4, !tbaa !5
  %215 = add nsw i32 %214, -1
  %216 = getelementptr inbounds i8, ptr %210, i64 4
  %217 = load i32, ptr %216, align 4, !tbaa !22
  %218 = getelementptr inbounds i8, ptr %210, i64 8
  %219 = load i32, ptr %218, align 8, !tbaa !23
  %220 = getelementptr inbounds i8, ptr %210, i64 12
  %221 = load i32, ptr %220, align 4, !tbaa !24
  %222 = sub nsw i32 0, %221
  call void @_Z7seg_updiiiii(i32 noundef 0, i32 noundef %215, i32 noundef %217, i32 noundef %219, i32 noundef %222)
  %223 = load i32, ptr @qtot, align 4, !tbaa !5
  %224 = add nsw i32 %223, -1
  store i32 %224, ptr @qtot, align 4, !tbaa !5
  %.not76 = icmp eq i32 %224, 0
  br i1 %.not76, label %.critedge, label %.lr.ph109, !llvm.loop !25

.critedge:                                        ; preds = %.lr.ph109, %213, %203, %196, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #6
  %225 = load i32, ptr @tot, align 4, !tbaa !5
  %226 = add nsw i32 %225, -1
  store i32 %226, ptr @tot, align 4, !tbaa !5
  %.not = icmp eq i32 %225, 0
  br i1 %.not, label %._crit_edge114, label %.lr.ph113, !llvm.loop !26

._crit_edge114:                                   ; preds = %.critedge, %._crit_edge106
  ret i32 0
}

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

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

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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!11, !10}
!12 = !{!13, !6, i64 4}
!13 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !6, i64 0}
!21 = !{!"_ZTS9Operation", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!22 = !{!21, !6, i64 4}
!23 = !{!21, !6, i64 8}
!24 = !{!21, !6, i64 12}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}


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