; LLVM IR from MtSaka/library :: test/yosupo/tree/tree_diameter.test (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.fastio::Printer" = type { i32, [131072 x i8], i32, i64 }
%struct.TreeDiameter = type { %struct.Graph.base, %"class.std::vector.1", %"class.std::vector.6" }
%struct.Graph.base = type <{ %"class.std::vector", i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.Edge = type <{ i32, i32, i64, i32, [4 x i8] }>

@_ZN6fastio2prE = external dso_local global %"struct.fastio::Printer", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.TreeDiameter, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #6
  %12 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN12TreeDiameterIxEC2Ei(ptr noundef nonnull align 8 dereferenceable(80) %3, i32 noundef %12)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sub nsw i32 %13, 1
  invoke void @_ZN5GraphIxE4readEiibb(ptr noundef nonnull align 8 dereferenceable(28) %3, i32 noundef %14, i32 noundef 0, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %15 unwind label %37

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %16 = invoke noundef i64 @_ZN12TreeDiameterIxE5buildEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %17 unwind label %41

17:                                               ; preds = %15
  store i64 %16, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %18 = getelementptr inbounds %struct.TreeDiameter, ptr %3, i32 0, i32 1
  %19 = call noundef i64 @_ZNKSt6vectorI4EdgeIxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %20 = add i64 %19, 1
  store i64 %20, ptr %7, align 8, !tbaa !11
  invoke void @_Z5printIxJmEEvRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %21 unwind label %45

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %22 = getelementptr inbounds %struct.TreeDiameter, ptr %3, i32 0, i32 1
  %23 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNSt6vectorI4EdgeIxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 0) #6
  %24 = getelementptr inbounds %struct.Edge, ptr %23, i32 0, i32 0
  %25 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %26 unwind label %41

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %27 = getelementptr inbounds %struct.TreeDiameter, ptr %3, i32 0, i32 1
  store ptr %27, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %28 = load ptr, ptr %8, align 8, !tbaa !13
  %29 = call ptr @_ZNSt6vectorI4EdgeIxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #6
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !13
  %32 = call ptr @_ZNSt6vectorI4EdgeIxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  br label %34

34:                                               ; preds = %57, %26
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeIxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %35, label %49, label %36

36:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %63

37:                                               ; preds = %0
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  br label %68

41:                                               ; preds = %63, %21, %15
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %4, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %5, align 4
  br label %67

45:                                               ; preds = %17
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %4, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %67

49:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %50 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeIxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  store ptr %50, ptr %11, align 8, !tbaa !13
  %51 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIA2_cEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull align 1 dereferenceable(2) @.str)
          to label %52 unwind label %59

52:                                               ; preds = %49
  %53 = load ptr, ptr %11, align 8, !tbaa !13
  %54 = getelementptr inbounds %struct.Edge, ptr %53, i32 0, i32 1
  %55 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) %51, ptr noundef nonnull align 4 dereferenceable(4) %54)
          to label %56 unwind label %59

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %57

57:                                               ; preds = %56
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4EdgeIxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br label %34

59:                                               ; preds = %52, %49
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %4, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %67

63:                                               ; preds = %36
  %64 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsEPFRS1_S2_E(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef @_ZN6fastio4endlILm131072ELb0EEERNS_7PrinterIXT_EXT0_EEES3_)
          to label %65 unwind label %41

65:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN12TreeDiameterIxED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %66 = load i32, ptr %1, align 4
  ret i32 %66

67:                                               ; preds = %59, %45, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %68

68:                                               ; preds = %67, %37
  call void @_ZN12TreeDiameterIxED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %4, align 8
  %71 = load i32, ptr %5, align 4
  %72 = insertvalue { ptr, i32 } poison, ptr %70, 0
  %73 = insertvalue { ptr, i32 } %72, i32 %71, 1
  resume { ptr, i32 } %73
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TreeDiameterIxEC2Ei(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5GraphIxE4readEiibb(ptr noundef nonnull align 8 dereferenceable(28), i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN12TreeDiameterIxE5buildEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(20) ptr @_ZNSt6vectorI4EdgeIxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIA2_cEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088), ptr noundef nonnull align 1 dereferenceable(2)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsEPFRS1_S2_E(ptr noundef nonnull align 8 dereferenceable(131088), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio4endlILm131072ELb0EEERNS_7PrinterIXT_EXT0_EEES3_(ptr noundef nonnull align 8 dereferenceable(131088)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12TreeDiameterIxED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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


; 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.fastio::Printer" = type { i32, [131072 x i8], i32, i64 }
%struct.TreeDiameter = type { %struct.Graph.base, %"class.std::vector.1", %"class.std::vector.6" }
%struct.Graph.base = type <{ %"class.std::vector", i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Edge<long long>>, std::allocator<std::vector<Edge<long long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Edge<long long>, std::allocator<Edge<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZN6fastio2prE = external dso_local global %"struct.fastio::Printer", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.TreeDiameter, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @_Z4scanIiJEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  %7 = load i32, ptr %1, align 4, !tbaa !5
  call void @_ZN12TreeDiameterIxEC2Ei(ptr noundef nonnull align 8 dereferenceable(80) %2, i32 noundef %7)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  invoke void @_ZN5GraphIxE4readEiibb(ptr noundef nonnull align 8 dereferenceable(28) %2, i32 noundef %9, i32 noundef 0, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %10 unwind label %24

10:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %11 = invoke noundef i64 @_ZN12TreeDiameterIxE5buildEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %12 unwind label %26

12:                                               ; preds = %10
  store i64 %11, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %13 = getelementptr inbounds i8, ptr %2, i64 32
  %14 = call noundef i64 @_ZNKSt6vectorI4EdgeIxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %15 = add i64 %14, 1
  store i64 %15, ptr %4, align 8, !tbaa !11
  invoke void @_Z5printIxJmEEvRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %16 unwind label %28

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %17 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNSt6vectorI4EdgeIxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef 0) #6
  %18 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %19 unwind label %26

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %20 = call ptr @_ZNSt6vectorI4EdgeIxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  store ptr %20, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %21 = call ptr @_ZNSt6vectorI4EdgeIxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  store ptr %21, ptr %6, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeIxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %35, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %23 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsEPFRS1_S2_E(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull @_ZN6fastio4endlILm131072ELb0EEERNS_7PrinterIXT_EXT0_EEES3_)
          to label %40 unwind label %26

24:                                               ; preds = %0
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %42

26:                                               ; preds = %._crit_edge, %16, %10
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %41

28:                                               ; preds = %12
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %41

.lr.ph:                                           ; preds = %19, %35
  %30 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4EdgeIxESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %31 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIA2_cEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) @_ZN6fastio2prE, ptr noundef nonnull align 1 dereferenceable(2) @.str)
          to label %32 unwind label %38

32:                                               ; preds = %.lr.ph
  %33 = getelementptr inbounds i8, ptr %30, i64 4
  %34 = invoke noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088) %31, ptr noundef nonnull align 4 dereferenceable(4) %33)
          to label %35 unwind label %38

35:                                               ; preds = %32
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4EdgeIxESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4EdgeIxESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %37, label %.lr.ph, label %._crit_edge

38:                                               ; preds = %32, %.lr.ph
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %41

40:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @_ZN12TreeDiameterIxED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

41:                                               ; preds = %38, %28, %26
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %27, %26 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %42

42:                                               ; preds = %41, %24
  %.pn.pn = phi { ptr, i32 } [ %.pn, %41 ], [ %25, %24 ]
  call void @_ZN12TreeDiameterIxED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TreeDiameterIxEC2Ei(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5GraphIxE4readEiibb(ptr noundef nonnull align 8 dereferenceable(28), i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN12TreeDiameterIxE5buildEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIxJmEEvRKT_DpRKT0_(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 i64 @_ZNKSt6vectorI4EdgeIxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIiEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(20) ptr @_ZNSt6vectorI4EdgeIxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsIA2_cEERS1_RKT_(ptr noundef nonnull align 8 dereferenceable(131088), ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio7PrinterILm131072ELb0EElsEPFRS1_S2_E(ptr noundef nonnull align 8 dereferenceable(131088), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(131088) ptr @_ZN6fastio4endlILm131072ELb0EEERNS_7PrinterIXT_EXT0_EEES3_(ptr noundef nonnull align 8 dereferenceable(131088)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12TreeDiameterIxED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass