; LLVM IR from Dev-XYS/Algorithms :: Prüfer-Sequence(Tree-to-Sequence) (main)

; 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.vertex = type { i32, i32, i32, i8 }
%struct.edge = type { i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"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 }

@V = external dso_local global [100010 x %struct.vertex], align 16
@E = external dso_local global [200010 x %struct.edge], align 16
@ivc = external dso_local global i32, align 4
@prufer = external dso_local global [100010 x i32], align 16
@pc = external dso_local global i32, align 4
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  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
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @ivc)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %23, %0
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = load i32, ptr @ivc, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2, ptr noundef %3)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %19, i32 noundef %20)
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %21, i32 noundef %22)
  br label %23

23:                                               ; preds = %17
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %4, align 4, !tbaa !5
  br label %12, !llvm.loop !9

26:                                               ; preds = %16
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %45, %26
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = load i32, ptr @ivc, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.vertex, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 16, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.edge, ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !14
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %32
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %44

44:                                               ; preds = %43, %32
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %27, !llvm.loop !16

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

49:                                               ; preds = %199, %48
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = load i32, ptr @ivc, align 4, !tbaa !5
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %202

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %8, align 4, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.vertex, ptr %60, i32 0, i32 2
  %62 = load i32, ptr %61, align 8, !tbaa !17
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %57, i32 noundef %62)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.vertex, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !17
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %134

70:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.vertex, ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 16, !tbaa !11
  store i32 %75, ptr %9, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %126, %70
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  store i32 11, ptr %7, align 4
  br label %132

80:                                               ; preds = %76
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.edge, ptr %83, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !18
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %86
  %88 = getelementptr inbounds %struct.vertex, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 8, !tbaa !17
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %125

91:                                               ; preds = %80
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %93
  %95 = getelementptr inbounds %struct.edge, ptr %94, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !18
  %97 = load i32, ptr @pc, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr @pc, align 4, !tbaa !5
  %99 = sext i32 %97 to i64
  %100 = getelementptr inbounds [100010 x i32], ptr @prufer, i64 0, i64 %99
  store i32 %96, ptr %100, align 4, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.edge, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !18
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.vertex, ptr %107, i32 0, i32 2
  store i32 0, ptr %108, align 8, !tbaa !17
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %110
  %112 = getelementptr inbounds %struct.edge, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !18
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.vertex, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !19
  %118 = icmp eq i32 %117, 1
  br i1 %118, label %119, label %124

119:                                              ; preds = %91
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.edge, ptr %122, i32 0, i32 0
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %123)
  br label %124

124:                                              ; preds = %119, %91
  store i32 11, ptr %7, align 4
  br label %132

125:                                              ; preds = %80
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %128
  %130 = getelementptr inbounds %struct.edge, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !14
  store i32 %131, ptr %9, align 4, !tbaa !5
  br label %76, !llvm.loop !20

132:                                              ; preds = %124, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %133

133:                                              ; preds = %132
  br label %198

134:                                              ; preds = %54
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.vertex, ptr %137, i32 0, i32 2
  %139 = load i32, ptr %138, align 8, !tbaa !17
  %140 = load i32, ptr @pc, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr @pc, align 4, !tbaa !5
  %142 = sext i32 %140 to i64
  %143 = getelementptr inbounds [100010 x i32], ptr @prufer, i64 0, i64 %142
  store i32 %139, ptr %143, align 4, !tbaa !5
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.vertex, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %147, align 8, !tbaa !17
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %149
  %151 = getelementptr inbounds %struct.vertex, ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 4, !tbaa !19
  %153 = add nsw i32 %152, -1
  store i32 %153, ptr %151, align 4, !tbaa !19
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.vertex, ptr %156, i32 0, i32 2
  %158 = load i32, ptr %157, align 8, !tbaa !17
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %159
  %161 = getelementptr inbounds %struct.vertex, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !19
  %163 = icmp eq i32 %162, 0
  br i1 %163, label %164, label %169

164:                                              ; preds = %134
  %165 = load i32, ptr %8, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %166
  %168 = getelementptr inbounds %struct.vertex, ptr %167, i32 0, i32 2
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %168)
  br label %197

169:                                              ; preds = %134
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.vertex, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 8, !tbaa !17
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %175
  %177 = getelementptr inbounds %struct.vertex, ptr %176, i32 0, i32 1
  %178 = load i32, ptr %177, align 4, !tbaa !19
  %179 = icmp eq i32 %178, 1
  br i1 %179, label %180, label %196

180:                                              ; preds = %169
  %181 = load i32, ptr %8, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %182
  %184 = getelementptr inbounds %struct.vertex, ptr %183, i32 0, i32 2
  %185 = load i32, ptr %184, align 8, !tbaa !17
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %186
  %188 = getelementptr inbounds %struct.vertex, ptr %187, i32 0, i32 2
  %189 = load i32, ptr %188, align 8, !tbaa !17
  %190 = icmp eq i32 %189, 0
  br i1 %190, label %191, label %196

191:                                              ; preds = %180
  %192 = load i32, ptr %8, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %193
  %195 = getelementptr inbounds %struct.vertex, ptr %194, i32 0, i32 2
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %195)
  br label %196

196:                                              ; preds = %191, %180, %169
  br label %197

197:                                              ; preds = %196, %164
  br label %198

198:                                              ; preds = %197, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %6, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %6, align 4, !tbaa !5
  br label %49, !llvm.loop !21

202:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %214, %202
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = load i32, ptr @pc, align 4, !tbaa !5
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %217

208:                                              ; preds = %203
  %209 = load i32, ptr %10, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [100010 x i32], ptr @prufer, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %212)
  br label %214

214:                                              ; preds = %208
  %215 = load i32, ptr %10, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %10, align 4, !tbaa !5
  br label %203, !llvm.loop !22

217:                                              ; preds = %207
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %218 = load i32, ptr %1, align 4
  ret i32 %218
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

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 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 = { 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 = { 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 = !{!"_ZTS6vertex", !6, i64 0, !6, i64 4, !6, i64 8, !13, i64 12}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = !{!12, !6, i64 8}
!18 = !{!15, !6, i64 0}
!19 = !{!12, !6, i64 4}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !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.vertex = type { i32, i32, i32, i8 }
%struct.edge = type { i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"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 }

@V = external dso_local global [100010 x %struct.vertex], align 16
@E = external dso_local global [200010 x %struct.edge], align 16
@ivc = external dso_local global i32, align 4
@prufer = external dso_local local_unnamed_addr global [100010 x i32], align 16
@pc = external dso_local local_unnamed_addr global i32, align 4
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse 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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @ivc)
  %5 = load i32, ptr @ivc, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 1
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  %7 = load i32, ptr @ivc, align 4, !tbaa !5
  %.not40 = icmp slt i32 %7, 1
  br i1 %.not40, label %._crit_edge44.thread, label %.lr.ph43

._crit_edge44.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02839 = phi i32 [ %13, %.lr.ph ], [ 1, %0 ]
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %9, i32 noundef %10)
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %1, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %11, i32 noundef %12)
  %13 = add nuw nsw i32 %.02839, 1
  %14 = load i32, ptr @ivc, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge44:                                    ; preds = %26
  %16 = icmp slt i32 %27, 3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br i1 %16, label %.preheader, label %.lr.ph52

.lr.ph43:                                         ; preds = %._crit_edge, %26
  %17 = phi i32 [ %27, %26 ], [ %7, %._crit_edge ]
  %storemerge41 = phi i32 [ %29, %26 ], [ 1, %._crit_edge ]
  %18 = sext i32 %storemerge41 to i64
  %19 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %18
  %20 = load i32, ptr %19, align 16, !tbaa !11
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %21, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !14
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %.lr.ph43
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  %.pre64 = load i32, ptr @ivc, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %.lr.ph43, %25
  %27 = phi i32 [ %17, %.lr.ph43 ], [ %.pre64, %25 ]
  %28 = phi i32 [ %storemerge41, %.lr.ph43 ], [ %.pre, %25 ]
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !5
  %.not.not = icmp slt i32 %28, %27
  br i1 %.not.not, label %.lr.ph43, label %._crit_edge44, !llvm.loop !16

.preheader:                                       ; preds = %.loopexit, %._crit_edge44.thread, %._crit_edge44
  %30 = load i32, ptr @pc, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph54, label %._crit_edge55

.lr.ph52:                                         ; preds = %._crit_edge44, %.loopexit
  %.02750 = phi i32 [ %70, %.loopexit ], [ 3, %._crit_edge44 ]
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %34
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !17
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33, i32 noundef %37)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %39 = load i32, ptr %36, align 8, !tbaa !17
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %.preheader35, label %57

.preheader35:                                     ; preds = %.lr.ph52
  %.02645 = load i32, ptr %35, align 16, !tbaa !5
  %.not3346 = icmp eq i32 %.02645, 0
  br i1 %.not3346, label %.loopexit, label %.lr.ph48

.lr.ph48:                                         ; preds = %.preheader35, %55
  %.02647 = phi i32 [ %.026, %55 ], [ %.02645, %.preheader35 ]
  %41 = sext i32 %.02647 to i64
  %42 = getelementptr inbounds [200010 x %struct.edge], ptr @E, i64 0, i64 %41
  %43 = load i32, ptr %42, align 8, !tbaa !18
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %44, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !17
  %.not34 = icmp eq i32 %46, 0
  br i1 %.not34, label %55, label %47

47:                                               ; preds = %.lr.ph48
  %48 = load i32, ptr @pc, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @pc, align 4, !tbaa !5
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds [100010 x i32], ptr @prufer, i64 0, i64 %50
  store i32 %43, ptr %51, align 4, !tbaa !5
  store i32 0, ptr %45, align 8, !tbaa !17
  %52 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %44, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %.loopexit.sink.split, label %.loopexit

55:                                               ; preds = %.lr.ph48
  %56 = getelementptr inbounds i8, ptr %42, i64 4
  %.026 = load i32, ptr %56, align 4, !tbaa !5
  %.not33 = icmp eq i32 %.026, 0
  br i1 %.not33, label %.loopexit, label %.lr.ph48, !llvm.loop !20

57:                                               ; preds = %.lr.ph52
  %58 = load i32, ptr @pc, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr @pc, align 4, !tbaa !5
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds [100010 x i32], ptr @prufer, i64 0, i64 %60
  store i32 %39, ptr %61, align 4, !tbaa !5
  %62 = sext i32 %39 to i64
  %63 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %62, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !19
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr %63, align 4, !tbaa !19
  switch i32 %64, label %.loopexit [
    i32 1, label %.loopexit.sink.split
    i32 2, label %66
  ]

66:                                               ; preds = %57
  %67 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %62, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !17
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %.loopexit.sink.split, label %.loopexit

.loopexit.sink.split:                             ; preds = %66, %57, %47
  %.lcssa71.sink = phi ptr [ %42, %47 ], [ %36, %57 ], [ %36, %66 ]
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(4) %.lcssa71.sink)
  br label %.loopexit

.loopexit:                                        ; preds = %55, %.loopexit.sink.split, %.preheader35, %57, %47, %66
  %70 = add nuw nsw i32 %.02750, 1
  %71 = load i32, ptr @ivc, align 4, !tbaa !5
  %.not32.not = icmp slt i32 %.02750, %71
  br i1 %.not32.not, label %.lr.ph52, label %.preheader, !llvm.loop !21

._crit_edge55:                                    ; preds = %.lr.ph54, %.preheader
  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

.lr.ph54:                                         ; preds = %.preheader, %.lr.ph54
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph54 ], [ 0, %.preheader ]
  %72 = getelementptr inbounds [100010 x i32], ptr @prufer, i64 0, i64 %indvars.iv
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %73)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %75 = load i32, ptr @pc, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next, %76
  br i1 %77, label %.lr.ph54, label %._crit_edge55, !llvm.loop !22
}

; 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 @_Z8add_edgeii(i32 noundef, i32 noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

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 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 = { 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 = { 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 = !{!"_ZTS6vertex", !6, i64 0, !6, i64 4, !6, i64 8, !13, i64 12}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = !{!12, !6, i64 8}
!18 = !{!15, !6, i64 0}
!19 = !{!12, !6, i64 4}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


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