; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 5/1471. Distance in the Tree.ll (Z3dfsiii)

; 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<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@neig = external dso_local global [50005 x %"class.std::vector"], align 16
@dep = external dso_local global [50005 x i32], align 16
@parent = external dso_local global [50005 x [20 x i32]], align 16
@weight = external dso_local global [50005 x [20 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %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 i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [50005 x i32], ptr @dep, i64 0, i64 %17
  store i32 %15, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %75, %3
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = icmp slt i32 %20, 20
  br i1 %21, label %23, label %22

22:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %78

23:                                               ; preds = %19
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %25
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = sub nsw i32 %27, 1
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [20 x i32], ptr %26, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %32
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [20 x i32], ptr %33, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %40
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [20 x i32], ptr %41, i64 0, i64 %43
  store i32 %38, ptr %44, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %46
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [20 x i32], ptr %47, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %54
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [20 x i32], ptr %55, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [20 x i32], ptr %62, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %52, %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [20 x i32], ptr %71, i64 0, i64 %73
  store i32 %68, ptr %74, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %23
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %7, align 4, !tbaa !5
  br label %19, !llvm.loop !9

78:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [50005 x %"class.std::vector"], ptr @neig, i64 0, i64 %80
  store ptr %81, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %82 = load ptr, ptr %8, align 8, !tbaa !11
  %83 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #5
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %83, ptr %84, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %85 = load ptr, ptr %8, align 8, !tbaa !11
  %86 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %85) #5
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  br label %88

88:                                               ; preds = %122, %78
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br i1 %89, label %91, label %90

90:                                               ; preds = %88
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %124

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %92 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %92, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %93 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %94 = load i32, ptr %93, align 4, !tbaa !13
  store i32 %94, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %95 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !15
  store i32 %96, ptr %14, align 4, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = icmp eq i32 %97, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %91
  store i32 6, ptr %11, align 4
  br label %116

101:                                              ; preds = %91
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = load i32, ptr %13, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %104
  %106 = getelementptr inbounds [20 x i32], ptr %105, i64 0, i64 0
  store i32 %102, ptr %106, align 16, !tbaa !5
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = load i32, ptr %13, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %109
  %111 = getelementptr inbounds [20 x i32], ptr %110, i64 0, i64 0
  store i32 %107, ptr %111, align 16, !tbaa !5
  %112 = load i32, ptr %13, align 4, !tbaa !5
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  call void @_Z3dfsiii(i32 noundef %112, i32 noundef %113, i32 noundef %115)
  store i32 0, ptr %11, align 4
  br label %116

116:                                              ; preds = %101, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %117 = load i32, ptr %11, align 4
  switch i32 %117, label %119 [
    i32 0, label %118
  ]

118:                                              ; preds = %116
  store i32 0, ptr %11, align 4
  br label %119

119:                                              ; preds = %118, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %120 = load i32, ptr %11, align 4
  switch i32 %120, label %125 [
    i32 0, label %121
    i32 6, label %122
  ]

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121, %119
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %88

124:                                              ; preds = %90
  ret void

125:                                              ; preds = %119
  unreachable
}

; 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 @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 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 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}


; 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<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@neig = external dso_local global [50005 x %"class.std::vector"], align 16
@dep = external dso_local local_unnamed_addr global [50005 x i32], align 16
@parent = external dso_local local_unnamed_addr global [50005 x [20 x i32]], align 16
@weight = external dso_local local_unnamed_addr global [50005 x [20 x i32]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = sext i32 %0 to i64
  %7 = getelementptr inbounds [50005 x i32], ptr @dep, i64 0, i64 %6
  store i32 %2, ptr %7, align 4, !tbaa !5
  %.phi.trans.insert31 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 0
  %.pre32 = load i32, ptr %.phi.trans.insert31, align 16, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 16, !tbaa !5
  %8 = sext i32 %.pre to i64
  %9 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %8, i64 0
  %10 = load i32, ptr %9, align 16, !tbaa !5
  %11 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 1
  store i32 %10, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %8, i64 0
  %13 = load i32, ptr %12, align 16, !tbaa !5
  %14 = add nsw i32 %13, %.pre32
  %15 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 1
  store i32 %14, ptr %15, align 4, !tbaa !5
  %16 = sext i32 %10 to i64
  %17 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %16, i64 1
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 2
  store i32 %18, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %16, i64 1
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %21, %14
  %23 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 2
  store i32 %22, ptr %23, align 8, !tbaa !5
  %24 = sext i32 %18 to i64
  %25 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %24, i64 2
  %26 = load i32, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 3
  store i32 %26, ptr %27, align 4, !tbaa !5
  %28 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %24, i64 2
  %29 = load i32, ptr %28, align 8, !tbaa !5
  %30 = add nsw i32 %29, %22
  %31 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 3
  store i32 %30, ptr %31, align 4, !tbaa !5
  %32 = sext i32 %26 to i64
  %33 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %32, i64 3
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 4
  store i32 %34, ptr %35, align 16, !tbaa !5
  %36 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %32, i64 3
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, %30
  %39 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 4
  store i32 %38, ptr %39, align 16, !tbaa !5
  %40 = sext i32 %34 to i64
  %41 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %40, i64 4
  %42 = load i32, ptr %41, align 16, !tbaa !5
  %43 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 5
  store i32 %42, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %40, i64 4
  %45 = load i32, ptr %44, align 16, !tbaa !5
  %46 = add nsw i32 %45, %38
  %47 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 5
  store i32 %46, ptr %47, align 4, !tbaa !5
  %48 = sext i32 %42 to i64
  %49 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %48, i64 5
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 6
  store i32 %50, ptr %51, align 8, !tbaa !5
  %52 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %48, i64 5
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, %46
  %55 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 6
  store i32 %54, ptr %55, align 8, !tbaa !5
  %56 = sext i32 %50 to i64
  %57 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %56, i64 6
  %58 = load i32, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 7
  store i32 %58, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %56, i64 6
  %61 = load i32, ptr %60, align 8, !tbaa !5
  %62 = add nsw i32 %61, %54
  %63 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 7
  store i32 %62, ptr %63, align 4, !tbaa !5
  %64 = sext i32 %58 to i64
  %65 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %64, i64 7
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 8
  store i32 %66, ptr %67, align 16, !tbaa !5
  %68 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %64, i64 7
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, %62
  %71 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 8
  store i32 %70, ptr %71, align 16, !tbaa !5
  %72 = sext i32 %66 to i64
  %73 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %72, i64 8
  %74 = load i32, ptr %73, align 16, !tbaa !5
  %75 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 9
  store i32 %74, ptr %75, align 4, !tbaa !5
  %76 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %72, i64 8
  %77 = load i32, ptr %76, align 16, !tbaa !5
  %78 = add nsw i32 %77, %70
  %79 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 9
  store i32 %78, ptr %79, align 4, !tbaa !5
  %80 = sext i32 %74 to i64
  %81 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %80, i64 9
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 10
  store i32 %82, ptr %83, align 8, !tbaa !5
  %84 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %80, i64 9
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %85, %78
  %87 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 10
  store i32 %86, ptr %87, align 8, !tbaa !5
  %88 = sext i32 %82 to i64
  %89 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %88, i64 10
  %90 = load i32, ptr %89, align 8, !tbaa !5
  %91 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 11
  store i32 %90, ptr %91, align 4, !tbaa !5
  %92 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %88, i64 10
  %93 = load i32, ptr %92, align 8, !tbaa !5
  %94 = add nsw i32 %93, %86
  %95 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 11
  store i32 %94, ptr %95, align 4, !tbaa !5
  %96 = sext i32 %90 to i64
  %97 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %96, i64 11
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 12
  store i32 %98, ptr %99, align 16, !tbaa !5
  %100 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %96, i64 11
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, %94
  %103 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 12
  store i32 %102, ptr %103, align 16, !tbaa !5
  %104 = sext i32 %98 to i64
  %105 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %104, i64 12
  %106 = load i32, ptr %105, align 16, !tbaa !5
  %107 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 13
  store i32 %106, ptr %107, align 4, !tbaa !5
  %108 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %104, i64 12
  %109 = load i32, ptr %108, align 16, !tbaa !5
  %110 = add nsw i32 %109, %102
  %111 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 13
  store i32 %110, ptr %111, align 4, !tbaa !5
  %112 = sext i32 %106 to i64
  %113 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %112, i64 13
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 14
  store i32 %114, ptr %115, align 8, !tbaa !5
  %116 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %112, i64 13
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, %110
  %119 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 14
  store i32 %118, ptr %119, align 8, !tbaa !5
  %120 = sext i32 %114 to i64
  %121 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %120, i64 14
  %122 = load i32, ptr %121, align 8, !tbaa !5
  %123 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 15
  store i32 %122, ptr %123, align 4, !tbaa !5
  %124 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %120, i64 14
  %125 = load i32, ptr %124, align 8, !tbaa !5
  %126 = add nsw i32 %125, %118
  %127 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 15
  store i32 %126, ptr %127, align 4, !tbaa !5
  %128 = sext i32 %122 to i64
  %129 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %128, i64 15
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 16
  store i32 %130, ptr %131, align 16, !tbaa !5
  %132 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %128, i64 15
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %133, %126
  %135 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 16
  store i32 %134, ptr %135, align 16, !tbaa !5
  %136 = sext i32 %130 to i64
  %137 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %136, i64 16
  %138 = load i32, ptr %137, align 16, !tbaa !5
  %139 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 17
  store i32 %138, ptr %139, align 4, !tbaa !5
  %140 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %136, i64 16
  %141 = load i32, ptr %140, align 16, !tbaa !5
  %142 = add nsw i32 %141, %134
  %143 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 17
  store i32 %142, ptr %143, align 4, !tbaa !5
  %144 = sext i32 %138 to i64
  %145 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %144, i64 17
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 18
  store i32 %146, ptr %147, align 8, !tbaa !5
  %148 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %144, i64 17
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %149, %142
  %151 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 18
  store i32 %150, ptr %151, align 8, !tbaa !5
  %152 = sext i32 %146 to i64
  %153 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %152, i64 18
  %154 = load i32, ptr %153, align 8, !tbaa !5
  %155 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %6, i64 19
  store i32 %154, ptr %155, align 4, !tbaa !5
  %156 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %152, i64 18
  %157 = load i32, ptr %156, align 8, !tbaa !5
  %158 = add nsw i32 %157, %150
  %159 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %6, i64 19
  store i32 %158, ptr %159, align 4, !tbaa !5
  %160 = getelementptr inbounds [50005 x %"class.std::vector"], ptr @neig, i64 0, i64 %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %161 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %160) #3
  store ptr %161, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %162 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %160) #3
  store ptr %162, ptr %5, align 8
  %163 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %163, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %164 = add nsw i32 %2, 1
  br label %165

._crit_edge:                                      ; preds = %172, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void

165:                                              ; preds = %.lr.ph, %172
  %166 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %.sroa.0.0.copyload = load i32, ptr %166, align 4
  %167 = icmp eq i32 %.sroa.0.0.copyload, %1
  br i1 %167, label %172, label %168

168:                                              ; preds = %165
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %166, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4
  %169 = sext i32 %.sroa.0.0.copyload to i64
  %170 = getelementptr inbounds [50005 x [20 x i32]], ptr @parent, i64 0, i64 %169
  store i32 %0, ptr %170, align 16, !tbaa !5
  %171 = getelementptr inbounds [50005 x [20 x i32]], ptr @weight, i64 0, i64 %169
  store i32 %.sroa.4.0.copyload, ptr %171, align 16, !tbaa !5
  call void @_Z3dfsiii(i32 noundef %.sroa.0.0.copyload, i32 noundef %0, i32 noundef %164)
  br label %172

172:                                              ; preds = %165, %168
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %174 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %174, label %165, label %._crit_edge
}

; 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 @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(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(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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


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