; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100917I)

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

@sz = external dso_local global [1048576 x i32], align 16
@nxt = external dso_local global [1048576 x i32], align 16
@lnk = external dso_local global [1048576 x i32], align 16
@tot = external dso_local global i32, align 4
@seq = external dso_local global [1048576 x i32], align 16
@e = external dso_local global [1048576 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@stdout = external global ptr, align 8

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1011807, ptr @nxt, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %42, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 1048576
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %17
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = ashr i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = and i32 %27, 1
  %29 = add nsw i32 %26, %28
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = mul nsw i64 487237, %34
  %36 = add nsw i64 %35, 1011807
  %37 = and i64 %36, 1048575
  %38 = trunc i64 %37 to i32
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %21
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

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

46:                                               ; preds = %63, %45
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 20
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %66

50:                                               ; preds = %46
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = shl i32 %51, 1
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = and i32 %56, 1
  %58 = or i32 %52, %57
  store i32 %58, ptr %4, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %3, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %50
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %5, align 4, !tbaa !5
  br label %46, !llvm.loop !11

66:                                               ; preds = %49
  call void @llvm.memset.p0.i64(ptr align 16 @lnk, i8 -1, i64 4194304, i1 false)
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z7addEdgeii(i32 noundef %67, i32 noundef %68)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %94, %66
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = icmp slt i32 %70, 1048576
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %97

73:                                               ; preds = %69
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = shl i32 %74, 1
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = and i32 %79, 1
  %81 = or i32 %75, %80
  store i32 %81, ptr %4, align 4, !tbaa !5
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = icmp sge i32 %82, 1048576
  br i1 %83, label %84, label %87

84:                                               ; preds = %73
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1048576
  store i32 %86, ptr %4, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %84, %73
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %3, align 4, !tbaa !5
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z7addEdgeii(i32 noundef %92, i32 noundef %93)
  br label %94

94:                                               ; preds = %87
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !12

97:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  %98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %120, %97
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = icmp slt i32 %100, 20
  br i1 %101, label %103, label %102

102:                                              ; preds = %99
  store i32 11, ptr %10, align 4
  br label %123

103:                                              ; preds = %99
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef 1)
  %105 = load ptr, ptr @stdout, align 8, !tbaa !13
  %106 = call i32 @fflush(ptr noundef %105)
  %107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %8)
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = icmp eq i32 %108, -1
  br i1 %109, label %110, label %111

110:                                              ; preds = %103
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  br label %123

111:                                              ; preds = %103
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = shl i32 %112, 1
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = icmp sgt i32 %114, %115
  %117 = zext i1 %116 to i32
  %118 = or i32 %113, %117
  store i32 %118, ptr %4, align 4, !tbaa !5
  %119 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %119, ptr %7, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %111
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %9, align 4, !tbaa !5
  br label %99, !llvm.loop !15

123:                                              ; preds = %110, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %124 = load i32, ptr %10, align 4
  switch i32 %124, label %258 [
    i32 11, label %125
  ]

125:                                              ; preds = %123
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %126 = load i32, ptr %4, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1048576 x i32], ptr @lnk, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  store i32 %129, ptr %11, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %144, %125
  %131 = load i32, ptr %11, align 4, !tbaa !5
  %132 = icmp ne i32 %131, -1
  br i1 %132, label %134, label %133

133:                                              ; preds = %130
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %150

134:                                              ; preds = %130
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1048576 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 !16
  %140 = load i32, ptr @tot, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr @tot, align 4, !tbaa !5
  %142 = sext i32 %140 to i64
  %143 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %142
  store i32 %139, ptr %143, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %134
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1048576 x %struct.Edge], ptr @e, i64 0, i64 %146
  %148 = getelementptr inbounds %struct.Edge, ptr %147, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !18
  store i32 %149, ptr %11, align 4, !tbaa !5
  br label %130, !llvm.loop !19

150:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %253, %150
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = icmp slt i32 %152, 200
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  store i32 17, ptr %10, align 4
  br label %256

155:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %175, %155
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = load i32, ptr @tot, align 4, !tbaa !5
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %178

161:                                              ; preds = %156
  %162 = load i32, ptr %14, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = and i32 %168, 1
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %174

171:                                              ; preds = %161
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %13, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %171, %161
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %14, align 4, !tbaa !5
  br label %156, !llvm.loop !20

178:                                              ; preds = %160
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = load i32, ptr @tot, align 4, !tbaa !5
  %181 = icmp eq i32 %179, %180
  br i1 %181, label %182, label %185

182:                                              ; preds = %178
  %183 = load i32, ptr %7, align 4, !tbaa !5
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %183)
  br label %187

185:                                              ; preds = %178
  %186 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef 1)
  br label %187

187:                                              ; preds = %185, %182
  %188 = load ptr, ptr @stdout, align 8, !tbaa !13
  %189 = call i32 @fflush(ptr noundef %188)
  %190 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %8)
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = icmp eq i32 %191, -1
  br i1 %192, label %193, label %194

193:                                              ; preds = %187
  store i32 17, ptr %10, align 4
  br label %250

194:                                              ; preds = %187
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %224, %194
  %196 = load i32, ptr %15, align 4, !tbaa !5
  %197 = load i32, ptr @tot, align 4, !tbaa !5
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %200, label %199

199:                                              ; preds = %195
  store i32 23, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %227

200:                                              ; preds = %195
  %201 = load i32, ptr %15, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = and i32 %207, 1
  %209 = load i32, ptr %7, align 4, !tbaa !5
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = icmp slt i32 %209, %210
  %212 = zext i1 %211 to i32
  %213 = icmp eq i32 %208, %212
  br i1 %213, label %214, label %223

214:                                              ; preds = %200
  %215 = load i32, ptr %15, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = load i32, ptr %13, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %219 to i64
  %222 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %221
  store i32 %218, ptr %222, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %214, %200
  br label %224

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

227:                                              ; preds = %199
  %228 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %228, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %245, %227
  %230 = load i32, ptr %16, align 4, !tbaa !5
  %231 = load i32, ptr @tot, align 4, !tbaa !5
  %232 = icmp slt i32 %230, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %229
  store i32 26, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %248

234:                                              ; preds = %229
  %235 = load i32, ptr %16, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = load i32, ptr %16, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %243
  store i32 %241, ptr %244, align 4, !tbaa !5
  br label %245

245:                                              ; preds = %234
  %246 = load i32, ptr %16, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %16, align 4, !tbaa !5
  br label %229, !llvm.loop !22

248:                                              ; preds = %233
  %249 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %249, ptr %7, align 4, !tbaa !5
  store i32 0, ptr %10, align 4
  br label %250

250:                                              ; preds = %248, %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %251 = load i32, ptr %10, align 4
  switch i32 %251, label %256 [
    i32 0, label %252
  ]

252:                                              ; preds = %250
  br label %253

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

256:                                              ; preds = %250, %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %257

257:                                              ; preds = %256
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  br label %258

258:                                              ; preds = %257, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %259 = load i32, ptr %1, align 4
  ret i32 %259
}

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

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

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

declare i32 @fflush(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 4}
!17 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!18 = !{!17, !6, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !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 }

@sz = external dso_local local_unnamed_addr global [1048576 x i32], align 16
@nxt = external dso_local local_unnamed_addr global [1048576 x i32], align 16
@lnk = external dso_local local_unnamed_addr global [1048576 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [1048576 x i32], align 16
@e = external dso_local local_unnamed_addr global [1048576 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

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

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

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  store i32 1011807, ptr @nxt, align 16, !tbaa !5
  br label %3

3:                                                ; preds = %14, %0
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next.1, %14 ]
  %4 = trunc nuw nsw i64 %indvars.iv to i32
  %5 = lshr i64 %indvars.iv, 1
  %6 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %5
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = add nsw i32 %7, 1
  %9 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv
  store i32 %8, ptr %9, align 4, !tbaa !5
  %10 = mul i32 %4, 487237
  %11 = add i32 %10, 1011807
  %12 = and i32 %11, 1048575
  %13 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %indvars.iv
  store i32 %12, ptr %13, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1048576
  br i1 %exitcond.not, label %.preheader82.preheader, label %14, !llvm.loop !9

14:                                               ; preds = %3
  %15 = trunc nuw nsw i64 %indvars.iv.next to i32
  %16 = lshr i64 %indvars.iv.next, 1
  %17 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv.next
  store i32 %18, ptr %19, align 4, !tbaa !5
  %20 = mul i32 %15, 487237
  %21 = add i32 %20, 1011807
  %22 = and i32 %21, 1048575
  %23 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %indvars.iv.next
  store i32 %22, ptr %23, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %3

.preheader82.preheader:                           ; preds = %3
  %24 = load i32, ptr @sz, align 16, !tbaa !5
  %25 = shl i32 %24, 1
  %26 = and i32 %25, 2
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 4047228), align 4, !tbaa !5
  %28 = and i32 %27, 1
  %29 = or disjoint i32 %28, %26
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @nxt, i64 4047228), align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %31
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = shl nuw nsw i32 %29, 2
  %37 = shl i32 %33, 1
  %38 = and i32 %37, 2
  %39 = or disjoint i32 %36, %38
  %40 = sext i32 %35 to i64
  %41 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = and i32 %42, 1
  %44 = or disjoint i32 %43, %39
  %45 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %40
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %47
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = shl nuw nsw i32 %44, 2
  %53 = shl i32 %49, 1
  %54 = and i32 %53, 2
  %55 = or disjoint i32 %52, %54
  %56 = sext i32 %51 to i64
  %57 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = and i32 %58, 1
  %60 = or disjoint i32 %59, %55
  %61 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %56
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %63
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = shl nuw nsw i32 %60, 2
  %69 = shl i32 %65, 1
  %70 = and i32 %69, 2
  %71 = or disjoint i32 %68, %70
  %72 = sext i32 %67 to i64
  %73 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = and i32 %74, 1
  %76 = or disjoint i32 %75, %71
  %77 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %72
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %79
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = shl nuw nsw i32 %76, 2
  %85 = shl i32 %81, 1
  %86 = and i32 %85, 2
  %87 = or disjoint i32 %84, %86
  %88 = sext i32 %83 to i64
  %89 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = and i32 %90, 1
  %92 = or disjoint i32 %91, %87
  %93 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %88
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %95
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = shl nuw nsw i32 %92, 2
  %101 = shl i32 %97, 1
  %102 = and i32 %101, 2
  %103 = or disjoint i32 %100, %102
  %104 = sext i32 %99 to i64
  %105 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = and i32 %106, 1
  %108 = or disjoint i32 %107, %103
  %109 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %104
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %111
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = shl nuw nsw i32 %108, 2
  %117 = shl i32 %113, 1
  %118 = and i32 %117, 2
  %119 = or disjoint i32 %116, %118
  %120 = sext i32 %115 to i64
  %121 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = and i32 %122, 1
  %124 = or disjoint i32 %123, %119
  %125 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %120
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %127
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = shl nuw nsw i32 %124, 2
  %133 = shl i32 %129, 1
  %134 = and i32 %133, 2
  %135 = or disjoint i32 %132, %134
  %136 = sext i32 %131 to i64
  %137 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = and i32 %138, 1
  %140 = or disjoint i32 %139, %135
  %141 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %136
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %143
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = shl nuw nsw i32 %140, 2
  %149 = shl i32 %145, 1
  %150 = and i32 %149, 2
  %151 = or disjoint i32 %148, %150
  %152 = sext i32 %147 to i64
  %153 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = and i32 %154, 1
  %156 = or disjoint i32 %155, %151
  %157 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %152
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %159
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = shl nuw nsw i32 %156, 2
  %165 = shl i32 %161, 1
  %166 = and i32 %165, 2
  %167 = or disjoint i32 %164, %166
  %168 = sext i32 %163 to i64
  %169 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = and i32 %170, 1
  %172 = or disjoint i32 %171, %167
  %173 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %168
  %174 = load i32, ptr %173, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4194304) @lnk, i8 -1, i64 4194304, i1 false)
  tail call void @_Z7addEdgeii(i32 noundef %172, i32 noundef %174)
  br label %177

175:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %176 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  br label %189

177:                                              ; preds = %.preheader82.preheader, %177
  %.05990 = phi i32 [ 1, %.preheader82.preheader ], [ %188, %177 ]
  %.16289 = phi i32 [ %172, %.preheader82.preheader ], [ %spec.select, %177 ]
  %.16688 = phi i32 [ %174, %.preheader82.preheader ], [ %187, %177 ]
  %178 = shl i32 %.16289, 1
  %179 = sext i32 %.16688 to i64
  %180 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = and i32 %181, 1
  %183 = or disjoint i32 %182, %178
  %184 = icmp sgt i32 %183, 1048575
  %185 = add nsw i32 %183, -1048576
  %spec.select = select i1 %184, i32 %185, i32 %183
  %186 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %179
  %187 = load i32, ptr %186, align 4, !tbaa !5
  tail call void @_Z7addEdgeii(i32 noundef %spec.select, i32 noundef %187)
  %188 = add nuw nsw i32 %.05990, 1
  %exitcond117.not = icmp eq i32 %188, 1048576
  br i1 %exitcond117.not, label %175, label %177, !llvm.loop !11

189:                                              ; preds = %175, %196
  %.05892 = phi i32 [ 0, %175 ], [ %202, %196 ]
  %.36491 = phi i32 [ 0, %175 ], [ %201, %196 ]
  %190 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1)
  %191 = load ptr, ptr @stdout, align 8, !tbaa !12
  %192 = call i32 @fflush(ptr noundef %191)
  %193 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %194 = load i32, ptr %2, align 4, !tbaa !5
  %195 = icmp eq i32 %194, -1
  br i1 %195, label %.critedge78, label %196

196:                                              ; preds = %189
  %197 = shl i32 %.36491, 1
  %198 = load i32, ptr %1, align 4, !tbaa !5
  %199 = icmp sgt i32 %194, %198
  %200 = zext i1 %199 to i32
  %201 = or disjoint i32 %197, %200
  store i32 %194, ptr %1, align 4, !tbaa !5
  %202 = add nuw nsw i32 %.05892, 1
  %exitcond118 = icmp eq i32 %202, 20
  br i1 %exitcond118, label %.critedge, label %189, !llvm.loop !14

.critedge:                                        ; preds = %196
  store i32 0, ptr @tot, align 4, !tbaa !5
  %203 = sext i32 %201 to i64
  %204 = getelementptr inbounds [1048576 x i32], ptr @lnk, i64 0, i64 %203
  %.05593 = load i32, ptr %204, align 4, !tbaa !5
  %.not94 = icmp eq i32 %.05593, -1
  br i1 %.not94, label %.preheader79.preheader, label %.lr.ph

.preheader79.preheader:                           ; preds = %..preheader80_crit_edge, %.critedge
  %.ph = phi i32 [ 0, %.critedge ], [ %205, %..preheader80_crit_edge ]
  br label %.preheader79

..preheader80_crit_edge:                          ; preds = %.lr.ph
  %205 = trunc nuw i64 %indvars.iv.next120 to i32
  store i32 %205, ptr @tot, align 4, !tbaa !5
  br label %.preheader79.preheader

.lr.ph:                                           ; preds = %.critedge, %.lr.ph
  %indvars.iv119 = phi i64 [ %indvars.iv.next120, %.lr.ph ], [ 0, %.critedge ]
  %.05595 = phi i32 [ %.055, %.lr.ph ], [ %.05593, %.critedge ]
  %206 = sext i32 %.05595 to i64
  %207 = getelementptr inbounds [1048576 x %struct.Edge], ptr @e, i64 0, i64 %206
  %208 = getelementptr inbounds i8, ptr %207, i64 4
  %209 = load i32, ptr %208, align 4, !tbaa !15
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %210 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv119
  store i32 %209, ptr %210, align 4, !tbaa !5
  %.055 = load i32, ptr %207, align 8, !tbaa !5
  %.not = icmp eq i32 %.055, -1
  br i1 %.not, label %..preheader80_crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge109.loopexit.loopexit.unr-lcssa:       ; preds = %.lr.ph108, %.lr.ph108.preheader
  %indvars.iv131.unr = phi i64 [ 0, %.lr.ph108.preheader ], [ %indvars.iv.next132.3, %.lr.ph108 ]
  %lcmp.mod157.not = icmp eq i64 %xtraiter155, 0
  br i1 %lcmp.mod157.not, label %._crit_edge109.loopexit, label %.lr.ph108.epil

.lr.ph108.epil:                                   ; preds = %._crit_edge109.loopexit.loopexit.unr-lcssa, %.lr.ph108.epil
  %indvars.iv131.epil = phi i64 [ %indvars.iv.next132.epil, %.lr.ph108.epil ], [ %indvars.iv131.unr, %._crit_edge109.loopexit.loopexit.unr-lcssa ]
  %epil.iter156 = phi i64 [ %epil.iter156.next, %.lr.ph108.epil ], [ 0, %._crit_edge109.loopexit.loopexit.unr-lcssa ]
  %211 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv131.epil
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  store i32 %215, ptr %211, align 4, !tbaa !5
  %indvars.iv.next132.epil = add nuw nsw i64 %indvars.iv131.epil, 1
  %epil.iter156.next = add i64 %epil.iter156, 1
  %epil.iter156.cmp.not = icmp eq i64 %epil.iter156.next, %xtraiter155
  br i1 %epil.iter156.cmp.not, label %._crit_edge109.loopexit, label %.lr.ph108.epil, !llvm.loop !18

._crit_edge109.loopexit:                          ; preds = %._crit_edge109.loopexit.loopexit.unr-lcssa, %.lr.ph108.epil, %._crit_edge104.thread, %._crit_edge104
  %.2.lcssa138 = phi i32 [ 0, %._crit_edge104.thread ], [ %.3.lcssa, %._crit_edge104 ], [ %.3.lcssa, %.lr.ph108.epil ], [ %.3.lcssa, %._crit_edge109.loopexit.loopexit.unr-lcssa ]
  store i32 %232, ptr %1, align 4, !tbaa !5
  %216 = add nuw nsw i32 %.054110, 1
  %exitcond136.not = icmp eq i32 %216, 200
  br i1 %exitcond136.not, label %.critedge78, label %.preheader79, !llvm.loop !20

.preheader79:                                     ; preds = %.preheader79.preheader, %._crit_edge109.loopexit
  %217 = phi i32 [ %232, %._crit_edge109.loopexit ], [ %194, %.preheader79.preheader ]
  %218 = phi i32 [ %.2.lcssa138, %._crit_edge109.loopexit ], [ %.ph, %.preheader79.preheader ]
  %.054110 = phi i32 [ %216, %._crit_edge109.loopexit ], [ 0, %.preheader79.preheader ]
  %219 = icmp sgt i32 %218, 0
  br i1 %219, label %.lr.ph99.preheader, label %._crit_edge

.lr.ph99.preheader:                               ; preds = %.preheader79
  %wide.trip.count = zext nneg i32 %218 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %220 = icmp ult i32 %218, 4
  br i1 %220, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph99.preheader.new

.lr.ph99.preheader.new:                           ; preds = %.lr.ph99.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph99

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph99, %.lr.ph99.preheader
  %spec.select76.lcssa.ph = phi i32 [ poison, %.lr.ph99.preheader ], [ %spec.select76.3, %.lr.ph99 ]
  %indvars.iv122.unr = phi i64 [ 0, %.lr.ph99.preheader ], [ %indvars.iv.next123.3, %.lr.ph99 ]
  %.05397.unr = phi i32 [ 0, %.lr.ph99.preheader ], [ %spec.select76.3, %.lr.ph99 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph99.epil

.lr.ph99.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph99.epil
  %indvars.iv122.epil = phi i64 [ %indvars.iv.next123.epil, %.lr.ph99.epil ], [ %indvars.iv122.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.05397.epil = phi i32 [ %spec.select76.epil, %.lr.ph99.epil ], [ %.05397.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph99.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %221 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv122.epil
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = and i32 %225, 1
  %spec.select76.epil = add i32 %226, %.05397.epil
  %indvars.iv.next123.epil = add nuw nsw i64 %indvars.iv122.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph99.epil, !llvm.loop !21

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph99.epil, %.preheader79
  %.053.lcssa = phi i32 [ 0, %.preheader79 ], [ %spec.select76.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %spec.select76.epil, %.lr.ph99.epil ]
  %227 = icmp eq i32 %.053.lcssa, %218
  %. = select i1 %227, i32 %217, i32 1
  %228 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.)
  %229 = load ptr, ptr @stdout, align 8, !tbaa !12
  %230 = call i32 @fflush(ptr noundef %229)
  %231 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %232 = load i32, ptr %2, align 4, !tbaa !5
  %.not74 = icmp eq i32 %232, -1
  br i1 %.not74, label %.critedge78, label %.preheader

.lr.ph99:                                         ; preds = %.lr.ph99, %.lr.ph99.preheader.new
  %indvars.iv122 = phi i64 [ 0, %.lr.ph99.preheader.new ], [ %indvars.iv.next123.3, %.lr.ph99 ]
  %.05397 = phi i32 [ 0, %.lr.ph99.preheader.new ], [ %spec.select76.3, %.lr.ph99 ]
  %niter = phi i64 [ 0, %.lr.ph99.preheader.new ], [ %niter.next.3, %.lr.ph99 ]
  %233 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv122
  %234 = load i32, ptr %233, align 16, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = and i32 %237, 1
  %spec.select76 = add i32 %238, %.05397
  %indvars.iv.next123 = or disjoint i64 %indvars.iv122, 1
  %239 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next123
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = and i32 %243, 1
  %spec.select76.1 = add i32 %244, %spec.select76
  %indvars.iv.next123.1 = or disjoint i64 %indvars.iv122, 2
  %245 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next123.1
  %246 = load i32, ptr %245, align 8, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = and i32 %249, 1
  %spec.select76.2 = add i32 %250, %spec.select76.1
  %indvars.iv.next123.2 = or disjoint i64 %indvars.iv122, 3
  %251 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next123.2
  %252 = load i32, ptr %251, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = and i32 %255, 1
  %spec.select76.3 = add i32 %256, %spec.select76.2
  %indvars.iv.next123.3 = add nuw nsw i64 %indvars.iv122, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph99, !llvm.loop !22

.preheader:                                       ; preds = %._crit_edge
  %257 = load i32, ptr @tot, align 4, !tbaa !5
  %258 = icmp sgt i32 %257, 0
  br i1 %258, label %.lr.ph103, label %._crit_edge104.thread

._crit_edge104.thread:                            ; preds = %.preheader
  store i32 0, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge109.loopexit

.lr.ph103:                                        ; preds = %.preheader
  %259 = load i32, ptr %1, align 4, !tbaa !5
  %260 = icmp sge i32 %259, %232
  %wide.trip.count129 = zext nneg i32 %257 to i64
  %xtraiter149 = and i64 %wide.trip.count129, 1
  %261 = icmp eq i32 %257, 1
  br i1 %261, label %._crit_edge104.unr-lcssa, label %.lr.ph103.new

.lr.ph103.new:                                    ; preds = %.lr.ph103
  %unroll_iter153 = and i64 %wide.trip.count129, 2147483646
  br label %275

._crit_edge104.unr-lcssa:                         ; preds = %299, %.lr.ph103
  %.3.lcssa.ph = phi i32 [ poison, %.lr.ph103 ], [ %.3.1, %299 ]
  %indvars.iv126.unr = phi i64 [ 0, %.lr.ph103 ], [ %indvars.iv.next127.1, %299 ]
  %.2101.unr = phi i32 [ 0, %.lr.ph103 ], [ %.3.1, %299 ]
  %lcmp.mod151.not = icmp eq i64 %xtraiter149, 0
  br i1 %lcmp.mod151.not, label %._crit_edge104, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge104.unr-lcssa
  %262 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv126.unr
  %263 = load i32, ptr %262, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = trunc i32 %266 to i1
  %268 = xor i1 %260, %267
  br i1 %268, label %269, label %._crit_edge104

269:                                              ; preds = %.epil.preheader
  %270 = add nsw i32 %.2101.unr, 1
  %271 = sext i32 %.2101.unr to i64
  %272 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %271
  store i32 %263, ptr %272, align 4, !tbaa !5
  br label %._crit_edge104

._crit_edge104:                                   ; preds = %.epil.preheader, %269, %._crit_edge104.unr-lcssa
  %.3.lcssa = phi i32 [ %.3.lcssa.ph, %._crit_edge104.unr-lcssa ], [ %270, %269 ], [ %.2101.unr, %.epil.preheader ]
  store i32 %.3.lcssa, ptr @tot, align 4, !tbaa !5
  %273 = icmp sgt i32 %.3.lcssa, 0
  br i1 %273, label %.lr.ph108.preheader, label %._crit_edge109.loopexit

.lr.ph108.preheader:                              ; preds = %._crit_edge104
  %wide.trip.count134 = zext nneg i32 %.3.lcssa to i64
  %xtraiter155 = and i64 %wide.trip.count134, 3
  %274 = icmp ult i32 %.3.lcssa, 4
  br i1 %274, label %._crit_edge109.loopexit.loopexit.unr-lcssa, label %.lr.ph108.preheader.new

.lr.ph108.preheader.new:                          ; preds = %.lr.ph108.preheader
  %unroll_iter158 = and i64 %wide.trip.count134, 2147483644
  br label %.lr.ph108

275:                                              ; preds = %299, %.lr.ph103.new
  %indvars.iv126 = phi i64 [ 0, %.lr.ph103.new ], [ %indvars.iv.next127.1, %299 ]
  %.2101 = phi i32 [ 0, %.lr.ph103.new ], [ %.3.1, %299 ]
  %niter154 = phi i64 [ 0, %.lr.ph103.new ], [ %niter154.next.1, %299 ]
  %276 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv126
  %277 = load i32, ptr %276, align 8, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %278
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = trunc i32 %280 to i1
  %282 = xor i1 %260, %281
  br i1 %282, label %283, label %287

283:                                              ; preds = %275
  %284 = add nsw i32 %.2101, 1
  %285 = sext i32 %.2101 to i64
  %286 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %285
  store i32 %277, ptr %286, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %275, %283
  %.3 = phi i32 [ %284, %283 ], [ %.2101, %275 ]
  %indvars.iv.next127 = or disjoint i64 %indvars.iv126, 1
  %288 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next127
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = trunc i32 %292 to i1
  %294 = xor i1 %260, %293
  br i1 %294, label %295, label %299

295:                                              ; preds = %287
  %296 = add nsw i32 %.3, 1
  %297 = sext i32 %.3 to i64
  %298 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %297
  store i32 %289, ptr %298, align 4, !tbaa !5
  br label %299

299:                                              ; preds = %295, %287
  %.3.1 = phi i32 [ %296, %295 ], [ %.3, %287 ]
  %indvars.iv.next127.1 = add nuw nsw i64 %indvars.iv126, 2
  %niter154.next.1 = add i64 %niter154, 2
  %niter154.ncmp.1 = icmp eq i64 %niter154.next.1, %unroll_iter153
  br i1 %niter154.ncmp.1, label %._crit_edge104.unr-lcssa, label %275, !llvm.loop !23

.lr.ph108:                                        ; preds = %.lr.ph108, %.lr.ph108.preheader.new
  %indvars.iv131 = phi i64 [ 0, %.lr.ph108.preheader.new ], [ %indvars.iv.next132.3, %.lr.ph108 ]
  %niter159 = phi i64 [ 0, %.lr.ph108.preheader.new ], [ %niter159.next.3, %.lr.ph108 ]
  %300 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv131
  %301 = load i32, ptr %300, align 16, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %302
  %304 = load i32, ptr %303, align 4, !tbaa !5
  store i32 %304, ptr %300, align 16, !tbaa !5
  %indvars.iv.next132 = or disjoint i64 %indvars.iv131, 1
  %305 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next132
  %306 = load i32, ptr %305, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %307
  %309 = load i32, ptr %308, align 4, !tbaa !5
  store i32 %309, ptr %305, align 4, !tbaa !5
  %indvars.iv.next132.1 = or disjoint i64 %indvars.iv131, 2
  %310 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next132.1
  %311 = load i32, ptr %310, align 8, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %312
  %314 = load i32, ptr %313, align 4, !tbaa !5
  store i32 %314, ptr %310, align 8, !tbaa !5
  %indvars.iv.next132.2 = or disjoint i64 %indvars.iv131, 3
  %315 = getelementptr inbounds [1048576 x i32], ptr @seq, i64 0, i64 %indvars.iv.next132.2
  %316 = load i32, ptr %315, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [1048576 x i32], ptr @nxt, i64 0, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !5
  store i32 %319, ptr %315, align 4, !tbaa !5
  %indvars.iv.next132.3 = add nuw nsw i64 %indvars.iv131, 4
  %niter159.next.3 = add i64 %niter159, 4
  %niter159.ncmp.3 = icmp eq i64 %niter159.next.3, %unroll_iter158
  br i1 %niter159.ncmp.3, label %._crit_edge109.loopexit.loopexit.unr-lcssa, label %.lr.ph108, !llvm.loop !24

.critedge78:                                      ; preds = %189, %._crit_edge109.loopexit, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 4}
!16 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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