; LLVM IR from tangjz/acm-icpc :: zoj (3229)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@lnk = external dso_local global [1401 x i32], align 16
@dt = external dso_local global [1401 x i32], align 16
@tot = external dso_local global i32, align 4
@pos = external dso_local global [38001 x i32], align 16
@low = external dso_local global [38001 x i32], align 16
@e = external dso_local global [76003 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

; 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
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  br label %22

22:                                               ; preds = %255, %253, %0
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %24 = icmp eq i32 %23, 2
  br i1 %24, label %25, label %256

25:                                               ; preds = %22
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = add nsw i32 %26, %27
  %29 = add nsw i32 %28, 4
  store i32 %29, ptr @N, align 4, !tbaa !5
  store i32 0, ptr @M, align 4, !tbaa !5
  %30 = load i32, ptr @N, align 4, !tbaa !5
  %31 = sub nsw i32 %30, 4
  store i32 %31, ptr @S, align 4, !tbaa !5
  %32 = load i32, ptr @N, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 3
  store i32 %33, ptr @T, align 4, !tbaa !5
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = mul i64 %35, 4
  call void @llvm.memset.p0.i64(ptr align 16 @lnk, i8 -1, i64 %36, i1 false)
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = mul i64 %38, 4
  call void @llvm.memset.p0.i64(ptr align 16 @dt, i8 0, i64 %39, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %65, %25
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %68

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5)
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = add nsw i32 %48, %49
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sub nsw i32 %53, %47
  store i32 %54, ptr %52, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = load i32, ptr @T, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = add nsw i32 %59, %55
  store i32 %60, ptr %58, align 4, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %61, %62
  %64 = load i32, ptr @T, align 4, !tbaa !5
  call void @_Z7addEdgeiii(i32 noundef %63, i32 noundef %64, i32 noundef 1061109567)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %65

65:                                               ; preds = %45
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %4, align 4, !tbaa !5
  br label %40, !llvm.loop !9

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

69:                                               ; preds = %116, %68
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %7, ptr noundef %8)
  %76 = load i32, ptr @S, align 4, !tbaa !5
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = load i32, ptr %8, align 4, !tbaa !5
  call void @_Z7addEdgeiii(i32 noundef %76, i32 noundef %77, i32 noundef %78)
  br label %79

79:                                               ; preds = %83, %74
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr %7, align 4, !tbaa !5
  %82 = icmp ne i32 %80, 0
  br i1 %82, label %83, label %115

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %9, ptr noundef %10, ptr noundef %11)
  %85 = load i32, ptr @M, align 4, !tbaa !5
  %86 = load i32, ptr @tot, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [38001 x i32], ptr @pos, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !5
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = load i32, ptr @tot, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @tot, align 4, !tbaa !5
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds [38001 x i32], ptr @low, i64 0, i64 %92
  store i32 %89, ptr %93, align 4, !tbaa !5
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sub nsw i32 %98, %94
  store i32 %99, ptr %97, align 4, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = add nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %106, %100
  store i32 %107, ptr %105, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = load i32, ptr %2, align 4, !tbaa !5
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = add nsw i32 %109, %110
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = sub nsw i32 %112, %113
  call void @_Z7addEdgeiii(i32 noundef %108, i32 noundef %111, i32 noundef %114)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %79, !llvm.loop !11

115:                                              ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !12

119:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %120 = load i32, ptr @N, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 2
  store i32 %121, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %122 = load i32, ptr @N, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %124 = load i32, ptr @M, align 4, !tbaa !5
  store i32 %124, ptr %15, 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 %125

125:                                              ; preds = %165, %119
  %126 = load i32, ptr %16, align 4, !tbaa !5
  %127 = load i32, ptr @N, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

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

130:                                              ; preds = %125
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp sgt i32 %134, 0
  br i1 %135, label %136, label %149

136:                                              ; preds = %130
  %137 = load i32, ptr %16, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = add nsw i32 %141, %140
  store i32 %142, ptr %12, align 4, !tbaa !5
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = load i32, ptr %16, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  call void @_Z7addEdgeiii(i32 noundef %143, i32 noundef %144, i32 noundef %148)
  br label %164

149:                                              ; preds = %130
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp slt i32 %153, 0
  br i1 %154, label %155, label %163

155:                                              ; preds = %149
  %156 = load i32, ptr %16, align 4, !tbaa !5
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = load i32, ptr %16, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = sub nsw i32 0, %161
  call void @_Z7addEdgeiii(i32 noundef %156, i32 noundef %157, i32 noundef %162)
  br label %163

163:                                              ; preds = %155, %149
  br label %164

164:                                              ; preds = %163, %136
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %16, align 4, !tbaa !5
  br label %125, !llvm.loop !13

168:                                              ; preds = %129
  %169 = load i32, ptr @T, align 4, !tbaa !5
  %170 = load i32, ptr @S, align 4, !tbaa !5
  call void @_Z7addEdgeiii(i32 noundef %169, i32 noundef %170, i32 noundef 1061109567)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @S, ptr noundef nonnull align 4 dereferenceable(4) %13) #6
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @T, ptr noundef nonnull align 4 dereferenceable(4) %14) #6
  %171 = call noundef i32 @_Z5dinicv()
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = icmp ne i32 %171, %172
  br i1 %173, label %174, label %176

174:                                              ; preds = %168
  %175 = call i32 @puts(ptr noundef @.str.3)
  store i32 2, ptr %17, align 4
  br label %253, !llvm.loop !14

176:                                              ; preds = %168
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @S, ptr noundef nonnull align 4 dereferenceable(4) %13) #6
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @T, ptr noundef nonnull align 4 dereferenceable(4) %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %177 = load i32, ptr @M, align 4, !tbaa !5
  %178 = sub nsw i32 %177, 1
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %179
  %181 = getelementptr inbounds %struct.Edge, ptr %180, i32 0, i32 2
  %182 = load i32, ptr %181, align 4, !tbaa !15
  store i32 %182, ptr %18, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %218, %176
  %184 = load i32, ptr %15, align 4, !tbaa !5
  %185 = load i32, ptr @M, align 4, !tbaa !5
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %187, label %221

187:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %188 = load i32, ptr @M, align 4, !tbaa !5
  %189 = sub nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %190
  %192 = getelementptr inbounds %struct.Edge, ptr %191, i32 0, i32 1
  %193 = load i32, ptr %192, align 4, !tbaa !17
  store i32 %193, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %194 = load i32, ptr @M, align 4, !tbaa !5
  %195 = sub nsw i32 %194, 2
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %196
  %198 = getelementptr inbounds %struct.Edge, ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 4, !tbaa !17
  store i32 %199, ptr %20, align 4, !tbaa !5
  %200 = load i32, ptr @M, align 4, !tbaa !5
  %201 = sub nsw i32 %200, 2
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %202
  %204 = getelementptr inbounds %struct.Edge, ptr %203, i32 0, i32 0
  %205 = load i32, ptr %204, align 4, !tbaa !18
  %206 = load i32, ptr %19, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1401 x i32], ptr @lnk, i64 0, i64 %207
  store i32 %205, ptr %208, align 4, !tbaa !5
  %209 = load i32, ptr @M, align 4, !tbaa !5
  %210 = sub nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %211
  %213 = getelementptr inbounds %struct.Edge, ptr %212, i32 0, i32 0
  %214 = load i32, ptr %213, align 4, !tbaa !18
  %215 = load i32, ptr %20, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [1401 x i32], ptr @lnk, i64 0, i64 %216
  store i32 %214, ptr %217, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %218

218:                                              ; preds = %187
  %219 = load i32, ptr @M, align 4, !tbaa !5
  %220 = sub nsw i32 %219, 2
  store i32 %220, ptr @M, align 4, !tbaa !5
  br label %183, !llvm.loop !19

221:                                              ; preds = %183
  %222 = call noundef i32 @_Z5dinicv()
  %223 = load i32, ptr %18, align 4, !tbaa !5
  %224 = add nsw i32 %223, %222
  store i32 %224, ptr %18, align 4, !tbaa !5
  %225 = load i32, ptr %18, align 4, !tbaa !5
  %226 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %225)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %248, %221
  %228 = load i32, ptr %21, align 4, !tbaa !5
  %229 = load i32, ptr @tot, align 4, !tbaa !5
  %230 = icmp slt i32 %228, %229
  br i1 %230, label %232, label %231

231:                                              ; preds = %227
  store i32 18, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %251

232:                                              ; preds = %227
  %233 = load i32, ptr %21, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [38001 x i32], ptr @pos, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = xor i32 %236, 1
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %238
  %240 = getelementptr inbounds %struct.Edge, ptr %239, i32 0, i32 2
  %241 = load i32, ptr %240, align 4, !tbaa !15
  %242 = load i32, ptr %21, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [38001 x i32], ptr @low, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = add nsw i32 %241, %245
  %247 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %246)
  br label %248

248:                                              ; preds = %232
  %249 = load i32, ptr %21, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %21, align 4, !tbaa !5
  br label %227, !llvm.loop !20

251:                                              ; preds = %231
  %252 = call i32 @puts(ptr noundef @.str.5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  store i32 0, ptr %17, align 4
  br label %253

253:                                              ; preds = %251, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %254 = load i32, ptr %17, align 4
  switch i32 %254, label %258 [
    i32 0, label %255
    i32 2, label %22
  ]

255:                                              ; preds = %253
  br label %22, !llvm.loop !14

256:                                              ; preds = %22
  store i32 0, ptr %1, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %257 = load i32, ptr %1, align 4
  ret i32 %257

258:                                              ; preds = %253
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7addEdgeiii(i32 noundef, i32 noundef, i32 noundef) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z5dinicv() #5

declare i32 @puts(ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!17 = !{!16, !6, i64 4}
!18 = !{!16, !6, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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, i32 }

@N = external dso_local local_unnamed_addr global i32, align 4
@M = external dso_local local_unnamed_addr global i32, align 4
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@lnk = external dso_local local_unnamed_addr global [1401 x i32], align 16
@dt = external dso_local local_unnamed_addr global [1401 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pos = external dso_local local_unnamed_addr global [38001 x i32], align 16
@low = external dso_local local_unnamed_addr global [38001 x i32], align 16
@e = external dso_local local_unnamed_addr global [76003 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %12 = icmp eq i32 %11, 2
  br i1 %12, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %0, %._crit_edge58
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add nsw i32 %14, %13
  %16 = add nsw i32 %15, 4
  store i32 %16, ptr @N, align 4, !tbaa !5
  store i32 0, ptr @M, align 4, !tbaa !5
  store i32 %15, ptr @S, align 4, !tbaa !5
  %17 = add nsw i32 %15, 1
  store i32 %17, ptr @T, align 4, !tbaa !5
  %18 = sext i32 %16 to i64
  %19 = shl nsw i64 %18, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @lnk, i8 -1, i64 %19, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dt, i8 0, i64 %19, i1 false)
  %20 = icmp sgt i32 %14, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph60
  %21 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %13, %.lr.ph60 ]
  store i32 0, ptr @tot, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph45, label %._crit_edge46

.lr.ph:                                           ; preds = %.lr.ph60, %.lr.ph
  %.03038 = phi i32 [ %36, %.lr.ph ], [ 0, %.lr.ph60 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = add nsw i32 %25, %.03038
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = sub nsw i32 %29, %24
  store i32 %30, ptr %28, align 4, !tbaa !5
  %31 = load i32, ptr @T, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, %24
  store i32 %35, ptr %33, align 4, !tbaa !5
  call void @_Z7addEdgeiii(i32 noundef %26, i32 noundef %31, i32 noundef 1061109567)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %36 = add nuw nsw i32 %.03038, 1
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !9

._crit_edge46:                                    ; preds = %._crit_edge42, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %39 = load i32, ptr @N, align 4, !tbaa !5
  %40 = add nsw i32 %39, -2
  store i32 %40, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %41 = add nsw i32 %39, -1
  store i32 %41, ptr %10, align 4, !tbaa !5
  %42 = load i32, ptr @M, align 4, !tbaa !5
  %43 = icmp sgt i32 %39, 0
  br i1 %43, label %.lr.ph50, label %._crit_edge51

.lr.ph45:                                         ; preds = %._crit_edge, %._crit_edge42
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge42 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %45 = load i32, ptr @S, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z7addEdgeiii(i32 noundef %45, i32 noundef %47, i32 noundef %46)
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %4, align 4, !tbaa !5
  %.not3739 = icmp eq i32 %48, 0
  br i1 %.not3739, label %._crit_edge42, label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph45
  %50 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %indvars.iv
  br label %51

51:                                               ; preds = %.lr.ph41, %51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %53 = load i32, ptr @M, align 4, !tbaa !5
  %54 = load i32, ptr @tot, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [38001 x i32], ptr @pos, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %54, 1
  store i32 %58, ptr @tot, align 4, !tbaa !5
  %59 = getelementptr inbounds [38001 x i32], ptr @low, i64 0, i64 %55
  store i32 %57, ptr %59, align 4, !tbaa !5
  %60 = load i32, ptr %50, align 4, !tbaa !5
  %61 = sub nsw i32 %60, %57
  store i32 %61, ptr %50, align 4, !tbaa !5
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = add nsw i32 %63, %62
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %67, %57
  store i32 %68, ptr %66, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sub nsw i32 %69, %57
  call void @_Z7addEdgeiii(i32 noundef %47, i32 noundef %64, i32 noundef %70)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr %4, align 4, !tbaa !5
  %.not37 = icmp eq i32 %71, 0
  br i1 %.not37, label %._crit_edge42, label %51, !llvm.loop !11

._crit_edge42:                                    ; preds = %51, %.lr.ph45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %73 = load i32, ptr %1, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next, %74
  br i1 %75, label %.lr.ph45, label %._crit_edge46, !llvm.loop !12

._crit_edge51:                                    ; preds = %92, %._crit_edge46
  %.033.lcssa = phi i32 [ 0, %._crit_edge46 ], [ %.1, %92 ]
  %76 = load i32, ptr @T, align 4, !tbaa !5
  %77 = load i32, ptr @S, align 4, !tbaa !5
  call void @_Z7addEdgeiii(i32 noundef %76, i32 noundef %77, i32 noundef 1061109567)
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @S, ptr noundef nonnull align 4 dereferenceable(4) %9) #6
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @T, ptr noundef nonnull align 4 dereferenceable(4) %10) #6
  %78 = call noundef i32 @_Z5dinicv()
  %.not = icmp eq i32 %78, %.033.lcssa
  br i1 %.not, label %96, label %._crit_edge58, !llvm.loop !13

.lr.ph50:                                         ; preds = %._crit_edge46, %92
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %92 ], [ 0, %._crit_edge46 ]
  %.03347 = phi i32 [ %.1, %92 ], [ 0, %._crit_edge46 ]
  %79 = getelementptr inbounds [1401 x i32], ptr @dt, i64 0, i64 %indvars.iv63
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %82, label %86

82:                                               ; preds = %.lr.ph50
  %83 = add nuw nsw i32 %80, %.03347
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = trunc nuw nsw i64 %indvars.iv63 to i32
  call void @_Z7addEdgeiii(i32 noundef %84, i32 noundef %85, i32 noundef %80)
  br label %92

86:                                               ; preds = %.lr.ph50
  %87 = icmp slt i32 %80, 0
  br i1 %87, label %88, label %92

88:                                               ; preds = %86
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sub nsw i32 0, %80
  %91 = trunc nuw nsw i64 %indvars.iv63 to i32
  call void @_Z7addEdgeiii(i32 noundef %91, i32 noundef %89, i32 noundef %90)
  br label %92

92:                                               ; preds = %82, %88, %86
  %.1 = phi i32 [ %83, %82 ], [ %.03347, %88 ], [ %.03347, %86 ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %93 = load i32, ptr @N, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = icmp slt i64 %indvars.iv.next64, %94
  br i1 %95, label %.lr.ph50, label %._crit_edge51, !llvm.loop !14

96:                                               ; preds = %._crit_edge51
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @S, ptr noundef nonnull align 4 dereferenceable(4) %9) #6
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) @T, ptr noundef nonnull align 4 dereferenceable(4) %10) #6
  %97 = load i32, ptr @M, align 4, !tbaa !5
  %98 = add nsw i32 %97, -1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %99, i32 2
  %101 = load i32, ptr %100, align 4, !tbaa !15
  %102 = icmp slt i32 %42, %97
  br i1 %102, label %.lr.ph53.preheader, label %120

.lr.ph53.preheader:                               ; preds = %96
  %103 = sext i32 %97 to i64
  %104 = sext i32 %42 to i64
  br label %.lr.ph53

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %.lr.ph53
  %indvars.iv66 = phi i64 [ %103, %.lr.ph53.preheader ], [ %indvars.iv.next67, %.lr.ph53 ]
  %105 = add nsw i64 %indvars.iv66, -1
  %106 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %105, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !17
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -2
  %108 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv.next67
  %109 = getelementptr inbounds i8, ptr %108, i64 4
  %110 = load i32, ptr %109, align 4, !tbaa !17
  %111 = load i32, ptr %108, align 4, !tbaa !18
  %112 = sext i32 %107 to i64
  %113 = getelementptr inbounds [1401 x i32], ptr @lnk, i64 0, i64 %112
  store i32 %111, ptr %113, align 4, !tbaa !5
  %114 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %105
  %115 = load i32, ptr %114, align 4, !tbaa !18
  %116 = sext i32 %110 to i64
  %117 = getelementptr inbounds [1401 x i32], ptr @lnk, i64 0, i64 %116
  store i32 %115, ptr %117, align 4, !tbaa !5
  %118 = icmp sgt i64 %indvars.iv.next67, %104
  br i1 %118, label %.lr.ph53, label %._crit_edge54, !llvm.loop !19

._crit_edge54:                                    ; preds = %.lr.ph53
  %119 = trunc nsw i64 %indvars.iv.next67 to i32
  store i32 %119, ptr @M, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %._crit_edge54, %96
  %121 = call noundef i32 @_Z5dinicv()
  %122 = add nsw i32 %121, %101
  %123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %122)
  %124 = load i32, ptr @tot, align 4, !tbaa !5
  %125 = icmp sgt i32 %124, 0
  br i1 %125, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %120, %.lr.ph57
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph57 ], [ 0, %120 ]
  %126 = getelementptr inbounds [38001 x i32], ptr @pos, i64 0, i64 %indvars.iv69
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = xor i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [76003 x %struct.Edge], ptr @e, i64 0, i64 %129, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !15
  %132 = getelementptr inbounds [38001 x i32], ptr @low, i64 0, i64 %indvars.iv69
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %133, %131
  %135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %134)
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %136 = load i32, ptr @tot, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = icmp slt i64 %indvars.iv.next70, %137
  br i1 %138, label %.lr.ph57, label %._crit_edge58, !llvm.loop !20

._crit_edge58:                                    ; preds = %.lr.ph57, %120, %._crit_edge51
  %.str.5.sink = phi ptr [ @.str.3, %._crit_edge51 ], [ @.str.5, %120 ], [ @.str.5, %.lr.ph57 ]
  %139 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.5.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  %140 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %141 = icmp eq i32 %140, 2
  br i1 %141, label %.lr.ph60, label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge58, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7addEdgeiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z5dinicv() local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!17 = !{!16, !6, i64 4}
!18 = !{!16, !6, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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