; LLVM IR from tangjz/acm-icpc :: codeforces/1578L.ll (Z5solvev)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Edge = type { i32, i32, i32 }
%class.anon.6 = type { i8 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.14" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon.18 = type { i8 }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.16" = type { i32, %"class.std::set" }
%"class.std::set" = type { %"class.std::_Rb_tree.10" }
%"class.std::_Rb_tree.10" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@c = external dso_local global [1000001 x i32], align 16
@dsu = external dso_local global [1000001 x i32], align 16
@idx = external dso_local global [1000001 x i32], align 16
@upp = external dso_local global [1000001 x i32], align 16
@e = external dso_local global [1000001 x %"class.std::vector"], align 16
@sz = external dso_local global [1000001 x i64], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE5edges = external hidden global [1000001 x %struct.Edge], align 16
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7dsuFindi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_Z3dfsi(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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Edge, align 4
  %7 = alloca %class.anon.6, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::map", align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.14", align 8
  %18 = alloca %"struct.std::pair.14", align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair.14", align 8
  %24 = alloca ptr, align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %33 = alloca i32, align 4
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca %class.anon.18, align 1
  %37 = alloca %"struct.std::pair", align 8
  %38 = alloca i64, align 8
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %50, %0
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = load i32, ptr @n, 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 %1) #7
  br label %53

45:                                               ; preds = %40
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr @c, i64 %47
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %48)
  br label %50

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

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %72, %53
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

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

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #7
  %61 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %3, align 4, !tbaa !5
  store i32 %63, ptr %61, align 4, !tbaa !11
  %64 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %4, align 4, !tbaa !5
  store i32 %66, ptr %64, align 4, !tbaa !13
  %67 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 2
  %68 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %68, ptr %67, align 4, !tbaa !14
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %70
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %71, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %72

72:                                               ; preds = %59
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %54, !llvm.loop !16

75:                                               ; preds = %58
  %76 = load i32, ptr @m, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %struct.Edge, ptr @_ZZ5solvevE5edges, i64 %77
  call void @"_ZSt4sortIPZ5solvevE4EdgeZ5solvevE3$_0EvT_S3_T0_"(ptr noundef @_ZZ5solvevE5edges, ptr noundef %78)
  %79 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %79, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %104, %75
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

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

85:                                               ; preds = %80
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %88
  store i32 %86, ptr %89, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %91
  store i32 -1, ptr %92, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1000001 x i32], ptr @c, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %99
  store i64 %97, ptr %100, align 8, !tbaa !17
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000001 x i32], ptr @upp, i64 0, i64 %102
  store i32 1061109567, ptr %103, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %85
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %8, align 4, !tbaa !5
  br label %80, !llvm.loop !19

107:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  br label %108

108:                                              ; preds = %358, %107
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %361

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  %114 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %266, %113
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr @m, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %119, label %131

119:                                              ; preds = %115
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.Edge, ptr %122, i32 0, i32 2
  %124 = load i32, ptr %123, align 4, !tbaa !14
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %126
  %128 = getelementptr inbounds %struct.Edge, ptr %127, i32 0, i32 2
  %129 = load i32, ptr %128, align 4, !tbaa !14
  %130 = icmp eq i32 %124, %129
  br label %131

131:                                              ; preds = %119, %115
  %132 = phi i1 [ false, %115 ], [ %130, %119 ]
  br i1 %132, label %133, label %269

133:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %135
  %137 = getelementptr inbounds %struct.Edge, ptr %136, i32 0, i32 0
  %138 = load i32, ptr %137, align 4, !tbaa !11
  %139 = invoke noundef i32 @_Z7dsuFindi(i32 noundef %138)
          to label %140 unwind label %152

140:                                              ; preds = %133
  store i32 %139, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %142
  %144 = getelementptr inbounds %struct.Edge, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 4, !tbaa !13
  %146 = invoke noundef i32 @_Z7dsuFindi(i32 noundef %145)
          to label %147 unwind label %156

147:                                              ; preds = %140
  store i32 %146, ptr %16, align 4, !tbaa !5
  %148 = load i32, ptr %13, align 4, !tbaa !5
  %149 = load i32, ptr %16, align 4, !tbaa !5
  %150 = icmp eq i32 %148, %149
  br i1 %150, label %151, label %160

151:                                              ; preds = %147
  store i32 16, ptr %11, align 4
  br label %262

152:                                              ; preds = %133
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %14, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %15, align 4
  br label %265

156:                                              ; preds = %259, %222, %220, %214, %208, %203, %197, %192, %171, %140
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %14, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %15, align 4
  br label %264

160:                                              ; preds = %147
  %161 = load i32, ptr %13, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr %16, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = icmp slt i32 %164, %168
  br i1 %169, label %170, label %171

170:                                              ; preds = %160
  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) %13, ptr noundef nonnull align 4 dereferenceable(4) %16) #7
  br label %171

171:                                              ; preds = %170, %160
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = load i32, ptr %16, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = icmp eq i32 %175, %179
  %181 = zext i1 %180 to i32
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = sub nsw i32 %185, %181
  store i32 %186, ptr %184, align 4, !tbaa !5
  %187 = load i32, ptr %16, align 4, !tbaa !5
  %188 = load i32, ptr %13, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %189
  store i32 %187, ptr %190, align 4, !tbaa !5
  %191 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %192 unwind label %156

192:                                              ; preds = %171
  %193 = load i32, ptr %13, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %194
  %196 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %191, ptr noundef nonnull align 4 dereferenceable(4) %195)
          to label %197 unwind label %156

197:                                              ; preds = %192
  %198 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %199 = extractvalue { ptr, i8 } %196, 0
  store ptr %199, ptr %198, align 8
  %200 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %201 = extractvalue { ptr, i8 } %196, 1
  store i8 %201, ptr %200, align 8
  %202 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %203 unwind label %156

203:                                              ; preds = %197
  %204 = load i32, ptr %16, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %205
  %207 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %202, ptr noundef nonnull align 4 dereferenceable(4) %206)
          to label %208 unwind label %156

208:                                              ; preds = %203
  %209 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %210 = extractvalue { ptr, i8 } %207, 0
  store ptr %210, ptr %209, align 8
  %211 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %212 = extractvalue { ptr, i8 } %207, 1
  store i8 %212, ptr %211, align 8
  %213 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %214 unwind label %156

214:                                              ; preds = %208
  %215 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %213) #7
  %216 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %217 unwind label %156

217:                                              ; preds = %214
  %218 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %216) #7
  %219 = icmp ugt i64 %215, %218
  br i1 %219, label %220, label %225

220:                                              ; preds = %217
  %221 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %222 unwind label %156

222:                                              ; preds = %220
  %223 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %224 unwind label %156

224:                                              ; preds = %222
  call void @_ZNSt3setIiSt4lessIiESaIiEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48) %221, ptr noundef nonnull align 8 dereferenceable(48) %223) #7
  br label %225

225:                                              ; preds = %224, %217
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %226 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %227 unwind label %237

227:                                              ; preds = %225
  store ptr %226, ptr %19, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %228 = load ptr, ptr %19, align 8, !tbaa !20
  %229 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %228) #7
  %230 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %229, ptr %230, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %231 = load ptr, ptr %19, align 8, !tbaa !20
  %232 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %231) #7
  %233 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %232, ptr %233, align 8
  br label %234

234:                                              ; preds = %252, %227
  %235 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %235, label %241, label %236

236:                                              ; preds = %234
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %259

237:                                              ; preds = %225
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %14, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %15, align 4
  br label %258

241:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %242 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %243 = load i32, ptr %242, align 4, !tbaa !5
  store i32 %243, ptr %22, align 4, !tbaa !5
  %244 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %245 unwind label %254

245:                                              ; preds = %241
  %246 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %244, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %247 unwind label %254

247:                                              ; preds = %245
  %248 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 0
  %249 = extractvalue { ptr, i8 } %246, 0
  store ptr %249, ptr %248, align 8
  %250 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 1
  %251 = extractvalue { ptr, i8 } %246, 1
  store i8 %251, ptr %250, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %252

252:                                              ; preds = %247
  %253 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %234

254:                                              ; preds = %245, %241
  %255 = landingpad { ptr, i32 }
          cleanup
  %256 = extractvalue { ptr, i32 } %255, 0
  store ptr %256, ptr %14, align 8
  %257 = extractvalue { ptr, i32 } %255, 1
  store i32 %257, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %258

258:                                              ; preds = %254, %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %264

259:                                              ; preds = %236
  %260 = invoke noundef i64 @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %261 unwind label %156

261:                                              ; preds = %259
  store i32 14, ptr %11, align 4
  br label %262

262:                                              ; preds = %261, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %263 = load i32, ptr %11, align 4
  switch i32 %263, label %387 [
    i32 16, label %266
    i32 14, label %269
  ]

264:                                              ; preds = %258, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %265

265:                                              ; preds = %264, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %360

266:                                              ; preds = %262
  %267 = load i32, ptr %10, align 4, !tbaa !5
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %10, align 4, !tbaa !5
  br label %115, !llvm.loop !22

269:                                              ; preds = %262, %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store ptr %12, ptr %24, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %270 = load ptr, ptr %24, align 8, !tbaa !20
  %271 = call ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %270) #7
  %272 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %271, ptr %272, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %273 = load ptr, ptr %24, align 8, !tbaa !20
  %274 = call ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %273) #7
  %275 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  store ptr %274, ptr %275, align 8
  br label %276

276:                                              ; preds = %350, %269
  %277 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #7
  br i1 %277, label %279, label %278

278:                                              ; preds = %276
  store i32 19, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %357

279:                                              ; preds = %276
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %280 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  store ptr %280, ptr %27, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %281 = load ptr, ptr %27, align 8, !tbaa !20
  %282 = getelementptr inbounds %"struct.std::pair.16", ptr %281, i32 0, i32 0
  %283 = load i32, ptr %282, align 8, !tbaa !23
  store i32 %283, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %284 = load i32, ptr @tot, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr @tot, align 4, !tbaa !5
  store i32 %284, ptr %29, align 4, !tbaa !5
  %286 = load i32, ptr %29, align 4, !tbaa !5
  %287 = load i32, ptr %28, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %288
  store i32 %286, ptr %289, align 4, !tbaa !5
  %290 = load i32, ptr %9, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %291
  %293 = getelementptr inbounds %struct.Edge, ptr %292, i32 0, i32 2
  %294 = load i32, ptr %293, align 4, !tbaa !14
  %295 = load i32, ptr %29, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1000001 x i32], ptr @upp, i64 0, i64 %296
  store i32 %294, ptr %297, align 4, !tbaa !5
  %298 = load i32, ptr %29, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %299
  store i64 0, ptr %300, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %301 = load ptr, ptr %27, align 8, !tbaa !20
  %302 = getelementptr inbounds %"struct.std::pair.16", ptr %301, i32 0, i32 1
  store ptr %302, ptr %30, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %303 = load ptr, ptr %30, align 8, !tbaa !20
  %304 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %303) #7
  %305 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %304, ptr %305, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %306 = load ptr, ptr %30, align 8, !tbaa !20
  %307 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %306) #7
  %308 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %32, i32 0, i32 0
  store ptr %307, ptr %308, align 8
  br label %309

309:                                              ; preds = %328, %279
  %310 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32) #7
  br i1 %310, label %312, label %311

311:                                              ; preds = %309
  store i32 21, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %334

312:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %313 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  %314 = load i32, ptr %313, align 4, !tbaa !5
  store i32 %314, ptr %33, align 4, !tbaa !5
  %315 = load i32, ptr %33, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %316
  %318 = load i64, ptr %317, align 8, !tbaa !17
  %319 = load i32, ptr %29, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %320
  %322 = load i64, ptr %321, align 8, !tbaa !17
  %323 = add nsw i64 %322, %318
  store i64 %323, ptr %321, align 8, !tbaa !17
  %324 = load i32, ptr %29, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e, i64 0, i64 %325
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %326, ptr noundef nonnull align 4 dereferenceable(4) %33)
          to label %327 unwind label %330

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

328:                                              ; preds = %327
  %329 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  br label %309

330:                                              ; preds = %312
  %331 = landingpad { ptr, i32 }
          cleanup
  %332 = extractvalue { ptr, i32 } %331, 0
  store ptr %332, ptr %14, align 8
  %333 = extractvalue { ptr, i32 } %331, 1
  store i32 %333, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %356

334:                                              ; preds = %311
  %335 = load i32, ptr %29, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e, i64 0, i64 %336
  %338 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %337) #7
  %339 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %338, ptr %339, align 8
  %340 = load i32, ptr %29, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e, i64 0, i64 %341
  %343 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %342) #7
  %344 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %343, ptr %344, align 8
  %345 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  %346 = load ptr, ptr %345, align 8
  %347 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  %348 = load ptr, ptr %347, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ5solvevE3$_1EvT_S8_T0_"(ptr %346, ptr %348)
          to label %349 unwind label %352

349:                                              ; preds = %334
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %350

350:                                              ; preds = %349
  %351 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  br label %276

352:                                              ; preds = %334
  %353 = landingpad { ptr, i32 }
          cleanup
  %354 = extractvalue { ptr, i32 } %353, 0
  store ptr %354, ptr %14, align 8
  %355 = extractvalue { ptr, i32 } %353, 1
  store i32 %355, ptr %15, align 4
  br label %356

356:                                              ; preds = %352, %330
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %360

357:                                              ; preds = %278
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  br label %358

358:                                              ; preds = %357
  %359 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %359, ptr %9, align 4, !tbaa !5
  br label %108, !llvm.loop !34

360:                                              ; preds = %356, %265
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %382

361:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #7
  %362 = load i32, ptr @tot, align 4, !tbaa !5
  %363 = sub nsw i32 %362, 1
  %364 = call { i64, i64 } @_Z3dfsi(i32 noundef %363)
  %365 = getelementptr inbounds { i64, i64 }, ptr %37, i32 0, i32 0
  %366 = extractvalue { i64, i64 } %364, 0
  store i64 %366, ptr %365, align 8
  %367 = getelementptr inbounds { i64, i64 }, ptr %37, i32 0, i32 1
  %368 = extractvalue { i64, i64 } %364, 1
  store i64 %368, ptr %367, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %369 = getelementptr inbounds %"struct.std::pair", ptr %37, i32 0, i32 0
  %370 = load i64, ptr %369, align 8, !tbaa !35
  %371 = getelementptr inbounds %"struct.std::pair", ptr %37, i32 0, i32 1
  %372 = load i64, ptr %371, align 8, !tbaa !37
  %373 = sub nsw i64 %370, %372
  store i64 %373, ptr %38, align 8, !tbaa !17
  %374 = load i64, ptr %38, align 8, !tbaa !17
  %375 = icmp sgt i64 %374, 0
  br i1 %375, label %376, label %378

376:                                              ; preds = %361
  %377 = load i64, ptr %38, align 8, !tbaa !17
  br label %379

378:                                              ; preds = %361
  br label %379

379:                                              ; preds = %378, %376
  %380 = phi i64 [ %377, %376 ], [ -1, %378 ]
  %381 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %380)
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #7
  ret void

382:                                              ; preds = %360
  %383 = load ptr, ptr %14, align 8
  %384 = load i32, ptr %15, align 4
  %385 = insertvalue { ptr, i32 } poison, ptr %383, 0
  %386 = insertvalue { ptr, i32 } %385, i32 %384, 1
  resume { ptr, i32 } %386

387:                                              ; preds = %262
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPZ5solvevE4EdgeZ5solvevE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

; 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)) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ5solvevE3$_1EvT_S8_T0_"(ptr, ptr) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSZ5solvevE4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = distinct !{!22, !10}
!23 = !{!24, !6, i64 0}
!24 = !{!"_ZTSSt4pairIKiSt3setIiSt4lessIiESaIiEEE", !6, i64 0, !25, i64 8}
!25 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !26, i64 0}
!26 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !27, i64 0}
!27 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !28, i64 0, !30, i64 8}
!28 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !29, i64 0}
!29 = !{!"_ZTSSt4lessIiE"}
!30 = !{!"_ZTSSt15_Rb_tree_header", !31, i64 0, !33, i64 32}
!31 = !{!"_ZTSSt18_Rb_tree_node_base", !32, i64 0, !21, i64 8, !21, i64 16, !21, i64 24}
!32 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!33 = !{!"long", !7, i64 0}
!34 = distinct !{!34, !10}
!35 = !{!36, !18, i64 0}
!36 = !{!"_ZTSSt4pairIxxE", !18, i64 0, !18, i64 8}
!37 = !{!36, !18, i64 8}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Edge = type { i32, i32, i32 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::set<int>>, std::_Select1st<std::pair<const int, std::set<int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local global [1000001 x i32], align 16
@dsu = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@idx = external dso_local global [1000001 x i32], align 16
@upp = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@e = external dso_local global [1000001 x %"class.std::vector"], align 16
@sz = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE5edges = external hidden global [1000001 x %struct.Edge], align 16
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_Z3dfsi(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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::map", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca i32, align 4
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %.preheader76

.preheader76:                                     ; preds = %.lr.ph, %0
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph85, label %.preheader76.._crit_edge_crit_edge

.preheader76.._crit_edge_crit_edge:               ; preds = %.preheader76
  %.pre130 = sext i32 %18 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %20 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %.preheader76, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph85, %.preheader76.._crit_edge_crit_edge
  %.pre-phi131 = phi i64 [ %.pre130, %.preheader76.._crit_edge_crit_edge ], [ %47, %.lr.ph85 ]
  %25 = getelementptr inbounds %struct.Edge, ptr @_ZZ5solvevE5edges, i64 %.pre-phi131
  call void @"_ZSt4sortIPZ5solvevE4EdgeZ5solvevE3$_0EvT_S3_T0_"(ptr noundef nonnull @_ZZ5solvevE5edges, ptr noundef nonnull %25)
  %26 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph88.preheader, label %.preheader

.lr.ph88.preheader:                               ; preds = %._crit_edge
  %28 = zext nneg i32 %26 to i64
  %29 = shl nuw nsw i64 %28, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dsu, i8 -1, i64 %29, i1 false), !tbaa !5
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @upp, i8 63, i64 %29, i1 false), !tbaa !5
  %min.iters.check = icmp ult i32 %26, 4
  br i1 %min.iters.check, label %.lr.ph88.preheader152, label %vector.ph

.lr.ph88.preheader152:                            ; preds = %middle.block, %.lr.ph88.preheader
  %indvars.iv116.ph = phi i64 [ 0, %.lr.ph88.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph88

vector.ph:                                        ; preds = %.lr.ph88.preheader
  %n.vec = and i64 %28, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
  %30 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 8
  store <2 x i32> %vec.ind, ptr %30, align 16, !tbaa !5
  store <2 x i32> %step.add, ptr %31, align 8, !tbaa !5
  %32 = getelementptr inbounds [1000001 x i32], ptr @c, i64 0, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %wide.load = load <2 x i32>, ptr %32, align 16, !tbaa !5
  %wide.load147 = load <2 x i32>, ptr %33, align 8, !tbaa !5
  %34 = sext <2 x i32> %wide.load to <2 x i64>
  %35 = sext <2 x i32> %wide.load147 to <2 x i64>
  %36 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %index
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store <2 x i64> %34, ptr %36, align 16, !tbaa !11
  store <2 x i64> %35, ptr %37, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %28
  br i1 %cmp.n, label %.preheader, label %.lr.ph88.preheader152

.lr.ph85:                                         ; preds = %.preheader76, %.lr.ph85
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %.lr.ph85 ], [ 0, %.preheader76 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %indvars.iv113
  store i32 %41, ptr %45, align 4, !tbaa !5
  %.sroa.446.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 4
  store i32 %43, ptr %.sroa.446.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 8
  store i32 %44, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next114, %47
  br i1 %48, label %.lr.ph85, label %._crit_edge, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph88, %middle.block, %._crit_edge
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph105, label %._crit_edge106

.lr.ph88:                                         ; preds = %.lr.ph88.preheader152, %.lr.ph88
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.lr.ph88 ], [ %indvars.iv116.ph, %.lr.ph88.preheader152 ]
  %51 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %indvars.iv116
  %52 = trunc nuw nsw i64 %indvars.iv116 to i32
  store i32 %52, ptr %51, align 4, !tbaa !5
  %53 = getelementptr inbounds [1000001 x i32], ptr @c, i64 0, i64 %indvars.iv116
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %indvars.iv116
  store i64 %55, ptr %56, align 8, !tbaa !11
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next117, %28
  br i1 %exitcond.not, label %.preheader, label %.lr.ph88, !llvm.loop !17

._crit_edge106.loopexit:                          ; preds = %._crit_edge102
  %.pre128 = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge106

._crit_edge106:                                   ; preds = %._crit_edge106.loopexit, %.preheader
  %57 = phi i32 [ %.pre128, %._crit_edge106.loopexit ], [ %26, %.preheader ]
  %58 = add nsw i32 %57, -1
  %59 = call { i64, i64 } @_Z3dfsi(i32 noundef %58)
  %60 = extractvalue { i64, i64 } %59, 0
  %61 = extractvalue { i64, i64 } %59, 1
  %62 = sub nsw i64 %60, %61
  %63 = icmp sgt i64 %62, 0
  %64 = select i1 %63, i64 %62, i64 -1
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %64)
  ret void

.lr.ph105:                                        ; preds = %.preheader, %._crit_edge102
  %.055103 = phi i32 [ %.05680, %._crit_edge102 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %67 = icmp slt i32 %.055103, %66
  br i1 %67, label %.lr.ph91, label %.critedge

.lr.ph91:                                         ; preds = %.lr.ph105
  %68 = sext i32 %.055103 to i64
  %69 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %68, i32 2
  br label %70

70:                                               ; preds = %.lr.ph91, %154
  %indvars.iv119 = phi i64 [ %68, %.lr.ph91 ], [ %indvars.iv.next120, %154 ]
  %71 = load i32, ptr %69, align 4, !tbaa !18
  %72 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %indvars.iv119
  %73 = getelementptr inbounds i8, ptr %72, i64 8
  %74 = load i32, ptr %73, align 4, !tbaa !18
  %75 = icmp eq i32 %71, %74
  br i1 %75, label %76, label %.critedge.loopexit

76:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %77 = load i32, ptr %72, align 4, !tbaa !20
  %78 = invoke noundef i32 @_Z7dsuFindi(i32 noundef %77)
          to label %79 unwind label %86

79:                                               ; preds = %76
  store i32 %78, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %80 = getelementptr inbounds i8, ptr %72, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !21
  %82 = invoke noundef i32 @_Z7dsuFindi(i32 noundef %81)
          to label %83 unwind label %.loopexit

83:                                               ; preds = %79
  store i32 %82, ptr %6, align 4, !tbaa !5
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = icmp eq i32 %84, %82
  br i1 %85, label %154, label %88

86:                                               ; preds = %76
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %153

.loopexit:                                        ; preds = %79
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %152

.loopexit.split-lp:                               ; preds = %98, %107, %112, %114, %119, %121, %127, %129, %._crit_edge97
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %152

88:                                               ; preds = %83
  %89 = trunc nsw i64 %indvars.iv119 to i32
  %90 = sext i32 %84 to i64
  %91 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %82 to i64
  %94 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp slt i32 %92, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %88
  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) %5, ptr noundef nonnull align 4 dereferenceable(4) %6) #7
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert122 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %.phi.trans.insert
  %.pre123 = load i32, ptr %.phi.trans.insert122, align 4, !tbaa !5
  %.pre124 = load i32, ptr %6, align 4, !tbaa !5
  %.phi.trans.insert125 = sext i32 %.pre124 to i64
  %.phi.trans.insert126 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %.phi.trans.insert125
  %.pre127 = load i32, ptr %.phi.trans.insert126, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %97, %88
  %.pre-phi129 = phi i64 [ %.phi.trans.insert125, %97 ], [ %93, %88 ]
  %.pre-phi = phi i64 [ %.phi.trans.insert, %97 ], [ %90, %88 ]
  %99 = phi i32 [ %.pre127, %97 ], [ %95, %88 ]
  %100 = phi i32 [ %.pre124, %97 ], [ %82, %88 ]
  %101 = phi i32 [ %.pre123, %97 ], [ %92, %88 ]
  %102 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %.pre-phi
  %103 = getelementptr inbounds [1000001 x i32], ptr @dsu, i64 0, i64 %.pre-phi129
  %104 = icmp eq i32 %101, %99
  %.neg = sext i1 %104 to i32
  %105 = add i32 %99, %.neg
  store i32 %105, ptr %103, align 4, !tbaa !5
  store i32 %100, ptr %102, align 4, !tbaa !5
  %106 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %107 unwind label %.loopexit.split-lp

107:                                              ; preds = %98
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %109
  %111 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %106, ptr noundef nonnull align 4 dereferenceable(4) %110)
          to label %112 unwind label %.loopexit.split-lp

112:                                              ; preds = %107
  %113 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %114 unwind label %.loopexit.split-lp

114:                                              ; preds = %112
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %116
  %118 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %113, ptr noundef nonnull align 4 dereferenceable(4) %117)
          to label %119 unwind label %.loopexit.split-lp

119:                                              ; preds = %114
  %120 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %121 unwind label %.loopexit.split-lp

121:                                              ; preds = %119
  %122 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %120) #7
  %123 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %124 unwind label %.loopexit.split-lp

124:                                              ; preds = %121
  %125 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %123) #7
  %126 = icmp ugt i64 %122, %125
  br i1 %126, label %127, label %132

127:                                              ; preds = %124
  %128 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %129 unwind label %.loopexit.split-lp

129:                                              ; preds = %127
  %130 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %131 unwind label %.loopexit.split-lp

131:                                              ; preds = %129
  call void @_ZNSt3setIiSt4lessIiESaIiEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48) %128, ptr noundef nonnull align 8 dereferenceable(48) %130) #7
  br label %132

132:                                              ; preds = %131, %124
  %133 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %134 unwind label %139

134:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %135 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %133) #7
  store ptr %135, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %136 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %133) #7
  store ptr %136, ptr %8, align 8
  %137 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %137, label %.lr.ph96, label %._crit_edge97

._crit_edge97:                                    ; preds = %146, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %138 = invoke noundef i64 @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %151 unwind label %.loopexit.split-lp

139:                                              ; preds = %132
  %140 = landingpad { ptr, i32 }
          cleanup
  br label %152

.lr.ph96:                                         ; preds = %134, %146
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %142 = load i32, ptr %141, align 4, !tbaa !5
  store i32 %142, ptr %9, align 4, !tbaa !5
  %143 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %144 unwind label %149

144:                                              ; preds = %.lr.ph96
  %145 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %143, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %146 unwind label %149

146:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %148 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %148, label %.lr.ph96, label %._crit_edge97

149:                                              ; preds = %144, %.lr.ph96
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %152

151:                                              ; preds = %._crit_edge97
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %.critedge

152:                                              ; preds = %.loopexit, %.loopexit.split-lp, %139, %149
  %.pn.pn = phi { ptr, i32 } [ %150, %149 ], [ %140, %139 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %153

153:                                              ; preds = %152, %86
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %152 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %204

154:                                              ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %indvars.iv.next120 = add nsw i64 %indvars.iv119, 1
  %155 = load i32, ptr @m, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = icmp slt i64 %indvars.iv.next120, %156
  br i1 %157, label %70, label %.critedge.loopexit, !llvm.loop !22

.critedge.loopexit:                               ; preds = %70, %154
  %indvars.iv119.lcssa.sink = phi i64 [ %indvars.iv.next120, %154 ], [ %indvars.iv119, %70 ]
  %158 = trunc i64 %indvars.iv119.lcssa.sink to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph105, %151
  %.05680 = phi i32 [ %89, %151 ], [ %.055103, %.lr.ph105 ], [ %158, %.critedge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %159 = call ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  store ptr %159, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %160 = call ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  store ptr %160, ptr %11, align 8
  %161 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %161, label %.lr.ph101, label %._crit_edge102

.lr.ph101:                                        ; preds = %.critedge
  %162 = sext i32 %.055103 to i64
  %163 = getelementptr inbounds [1000001 x %struct.Edge], ptr @_ZZ5solvevE5edges, i64 0, i64 %162, i32 2
  br label %166

._crit_edge102:                                   ; preds = %198, %.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #7
  %164 = load i32, ptr @m, align 4, !tbaa !5
  %165 = icmp slt i32 %.05680, %164
  br i1 %165, label %.lr.ph105, label %._crit_edge106.loopexit, !llvm.loop !23

166:                                              ; preds = %.lr.ph101, %198
  %167 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %168 = load i32, ptr %167, align 8, !tbaa !24
  %169 = load i32, ptr @tot, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr @tot, align 4, !tbaa !5
  %171 = sext i32 %168 to i64
  %172 = getelementptr inbounds [1000001 x i32], ptr @idx, i64 0, i64 %171
  store i32 %169, ptr %172, align 4, !tbaa !5
  %173 = load i32, ptr %163, align 4, !tbaa !18
  %174 = sext i32 %169 to i64
  %175 = getelementptr inbounds [1000001 x i32], ptr @upp, i64 0, i64 %174
  store i32 %173, ptr %175, align 4, !tbaa !5
  %176 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %174
  store i64 0, ptr %176, align 8, !tbaa !11
  %177 = getelementptr inbounds i8, ptr %167, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %178 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %177) #7
  store ptr %178, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %179 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %177) #7
  store ptr %179, ptr %13, align 8
  %180 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %180, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %166
  %181 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e, i64 0, i64 %174
  br label %185

._crit_edge100:                                   ; preds = %193, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %182 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @e, i64 0, i64 %174
  %183 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %182) #7
  %184 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %182) #7
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ5solvevE3$_1EvT_S8_T0_"(ptr %183, ptr %184)
          to label %198 unwind label %201

185:                                              ; preds = %.lr.ph99, %193
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %187 = load i32, ptr %186, align 4, !tbaa !5
  store i32 %187, ptr %14, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [1000001 x i64], ptr @sz, i64 0, i64 %188
  %190 = load i64, ptr %189, align 8, !tbaa !11
  %191 = load i64, ptr %176, align 8, !tbaa !11
  %192 = add nsw i64 %191, %190
  store i64 %192, ptr %176, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %181, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %193 unwind label %196

193:                                              ; preds = %185
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %195 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br i1 %195, label %185, label %._crit_edge100

196:                                              ; preds = %185
  %197 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %203

198:                                              ; preds = %._crit_edge100
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %200 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %200, label %166, label %._crit_edge102

201:                                              ; preds = %._crit_edge100
  %202 = landingpad { ptr, i32 }
          cleanup
  br label %203

203:                                              ; preds = %201, %196
  %.pn70 = phi { ptr, i32 } [ %197, %196 ], [ %202, %201 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %204

204:                                              ; preds = %203, %153
  %.pn70.pn = phi { ptr, i32 } [ %.pn70, %203 ], [ %.pn.pn.pn, %153 ]
  call void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn70.pn
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPZ5solvevE4EdgeZ5solvevE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

; 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 #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZ5solvevE3$_1EvT_S8_T0_"(ptr, ptr) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiSt3setIiSt4lessIiESaIiEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiSt3setIiSt4lessIiESaIiEES2_SaISt4pairIKiS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
!18 = !{!19, !6, i64 8}
!19 = !{!"_ZTSZ5solvevE4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!20 = !{!19, !6, i64 0}
!21 = !{!19, !6, i64 4}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSSt4pairIKiSt3setIiSt4lessIiESaIiEEE", !6, i64 0, !26, i64 8}
!26 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !29, i64 0, !31, i64 8}
!29 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !30, i64 0}
!30 = !{!"_ZTSSt4lessIiE"}
!31 = !{!"_ZTSSt15_Rb_tree_header", !32, i64 0, !35, i64 32}
!32 = !{!"_ZTSSt18_Rb_tree_node_base", !33, i64 0, !34, i64 8, !34, i64 16, !34, i64 24}
!33 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!34 = !{!"any pointer", !7, i64 0}
!35 = !{!"long", !7, i64 0}


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