; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint July/Problem H/H.ll (Z4dfs3ii)

; 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 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { ptr }

@n = external dso_local global i32, align 4
@g = external dso_local global [262144 x %"class.std::vector"], align 16
@l = external dso_local global [262144 x i32], align 16
@r = external dso_local global [262144 x i32], align 16
@subtree = external dso_local global [262144 x %"class.std::vector"], align 16
@cost = external dso_local global [262144 x i32], align 16
@type = external dso_local global [262144 x i32], align 16
@tkt = external dso_local global [262144 x %"class.std::vector"], align 16
@ans = external dso_local global i64, align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiixiii(i32 noundef, i32 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5queryv() #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3LCAii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(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 ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4dfs3ii(i32 noundef %0, i32 noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::vector.0", align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %27 = alloca i32, align 4
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %33 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"struct.std::pair", align 4
  %36 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %38
  %40 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #5
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  br label %42

42:                                               ; preds = %134, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %44
  %46 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #5
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %51 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %52 = getelementptr inbounds %"struct.std::pair", ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !9
  store i32 %53, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %54 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !11
  store i32 %56, ptr %9, align 4, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [262144 x i32], ptr @type, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %115

62:                                               ; preds = %50
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = call noundef i32 @_Z3LCAii(i32 noundef %63, i32 noundef %64)
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = icmp eq i32 %65, %66
  br i1 %67, label %68, label %114

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @subtree, i64 0, i64 %70
  %72 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #5
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @subtree, i64 0, i64 %75
  %77 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #5
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %77, ptr %78, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %80
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %83
  %85 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %84)
  store i64 %85, ptr %13, align 4
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  %90 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr %87, ptr %89, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %91 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %92 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #5
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %95 = getelementptr inbounds %"struct.std::pair", ptr %94, i32 0, i32 0
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateiixiii(i32 noundef 0, i32 noundef %96, i64 noundef %101, i32 noundef 1, i32 noundef 0, i32 noundef %102)
  %103 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !11
  %106 = add nsw i32 %105, 1
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateiixiii(i32 noundef %106, i32 noundef %107, i64 noundef %112, i32 noundef 1, i32 noundef 0, i32 noundef %113)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %114

114:                                              ; preds = %68, %62
  store i32 4, ptr %7, align 4
  br label %131

115:                                              ; preds = %50
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateiixiii(i32 noundef %119, i32 noundef %124, i64 noundef %129, i32 noundef 1, i32 noundef 0, i32 noundef %130)
  store i32 0, ptr %7, align 4
  br label %131

131:                                              ; preds = %115, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %132 = load i32, ptr %7, align 4
  switch i32 %132, label %501 [
    i32 0, label %133
    i32 4, label %134
  ]

133:                                              ; preds = %131
  br label %134

134:                                              ; preds = %133, %131
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br label %42, !llvm.loop !12

136:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %137 = call noundef i64 @_Z5queryv()
  store i64 %137, ptr %15, align 8, !tbaa !14
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %139 = load i64, ptr %138, align 8, !tbaa !14
  store i64 %139, ptr @ans, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %140 = load i32, ptr %3, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @g, i64 0, i64 %141
  %143 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #5
  %144 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  br label %145

145:                                              ; preds = %389, %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %146 = load i32, ptr %3, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @g, i64 0, i64 %147
  %149 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #5
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  %151 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br i1 %151, label %153, label %152

152:                                              ; preds = %145
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %392

153:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %154 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %155 = getelementptr inbounds %"struct.std::pair", ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 4, !tbaa !9
  store i32 %156, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %157 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %158 = getelementptr inbounds %"struct.std::pair", ptr %157, i32 0, i32 1
  %159 = load i32, ptr %158, align 4, !tbaa !11
  store i32 %159, ptr %20, align 4, !tbaa !5
  %160 = load i32, ptr %19, align 4, !tbaa !5
  %161 = load i32, ptr %4, align 4, !tbaa !5
  %162 = icmp eq i32 %160, %161
  br i1 %162, label %163, label %164

163:                                              ; preds = %153
  store i32 7, ptr %7, align 4
  br label %386

164:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  br label %165

165:                                              ; preds = %260, %258, %186, %164
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = load i32, ptr %3, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %169
  %171 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %170) #5
  %172 = icmp ult i64 %167, %171
  br i1 %172, label %173, label %265

173:                                              ; preds = %165
  %174 = load i32, ptr %3, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %175
  %177 = load i32, ptr %16, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %176, i64 noundef %178) #5
  %180 = getelementptr inbounds %"struct.std::pair", ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 4, !tbaa !11
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [262144 x i32], ptr @type, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = icmp ne i32 %184, 0
  br i1 %185, label %189, label %186

186:                                              ; preds = %173
  %187 = load i32, ptr %16, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %16, align 4, !tbaa !5
  br label %165, !llvm.loop !16

189:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %190 = load i32, ptr %3, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %191
  %193 = load i32, ptr %16, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %192, i64 noundef %194) #5
  %196 = getelementptr inbounds %"struct.std::pair", ptr %195, i32 0, i32 0
  %197 = load i32, ptr %196, align 4, !tbaa !9
  store i32 %197, ptr %22, align 4, !tbaa !5
  %198 = load i32, ptr %22, align 4, !tbaa !5
  %199 = load i32, ptr %3, align 4, !tbaa !5
  %200 = call noundef i32 @_Z3LCAii(i32 noundef %198, i32 noundef %199)
  %201 = load i32, ptr %22, align 4, !tbaa !5
  %202 = icmp eq i32 %200, %201
  br i1 %202, label %203, label %206

203:                                              ; preds = %189
  %204 = load i32, ptr %16, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %16, align 4, !tbaa !5
  store i32 8, ptr %7, align 4
  br label %258, !llvm.loop !16

206:                                              ; preds = %189
  %207 = load i32, ptr %22, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = load i32, ptr %19, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = icmp slt i32 %210, %214
  br i1 %215, label %216, label %219

216:                                              ; preds = %206
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %16, align 4, !tbaa !5
  store i32 8, ptr %7, align 4
  br label %258, !llvm.loop !16

219:                                              ; preds = %206
  %220 = load i32, ptr %22, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = load i32, ptr %19, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = icmp sgt i32 %223, %227
  br i1 %228, label %229, label %230

229:                                              ; preds = %219
  store i32 9, ptr %7, align 4
  br label %258

230:                                              ; preds = %219
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %231 unwind label %261

231:                                              ; preds = %230
  %232 = load i32, ptr %22, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = load i32, ptr %22, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %242
  %244 = load i32, ptr %16, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %243, i64 noundef %245) #5
  %247 = getelementptr inbounds %"struct.std::pair", ptr %246, i32 0, i32 1
  %248 = load i32, ptr %247, align 4, !tbaa !11
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sub nsw i32 0, %251
  %253 = sext i32 %252 to i64
  %254 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef %235, i32 noundef %240, i64 noundef %253, i32 noundef 1, i32 noundef 0, i32 noundef %254)
          to label %255 unwind label %261

255:                                              ; preds = %231
  %256 = load i32, ptr %16, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %16, align 4, !tbaa !5
  store i32 0, ptr %7, align 4
  br label %258

258:                                              ; preds = %255, %229, %216, %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %259 = load i32, ptr %7, align 4
  switch i32 %259, label %501 [
    i32 0, label %260
    i32 8, label %165
    i32 9, label %265
  ]

260:                                              ; preds = %258
  br label %165, !llvm.loop !16

261:                                              ; preds = %231, %230
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %23, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %391

265:                                              ; preds = %258, %165
  %266 = load i32, ptr %19, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = load i32, ptr %20, align 4, !tbaa !5
  %271 = sub nsw i32 0, %270
  %272 = sext i32 %271 to i64
  %273 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef 0, i32 noundef %269, i64 noundef %272, i32 noundef 1, i32 noundef 0, i32 noundef %273)
          to label %274 unwind label %341

274:                                              ; preds = %265
  %275 = load i32, ptr %19, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = load i32, ptr %19, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  %284 = load i32, ptr %20, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef %278, i32 noundef %283, i64 noundef %285, i32 noundef 1, i32 noundef 0, i32 noundef %286)
          to label %287 unwind label %341

287:                                              ; preds = %274
  %288 = load i32, ptr %19, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %289
  %291 = load i32, ptr %290, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  %293 = load i32, ptr @n, align 4, !tbaa !5
  %294 = load i32, ptr %20, align 4, !tbaa !5
  %295 = sub nsw i32 0, %294
  %296 = sext i32 %295 to i64
  %297 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef %292, i32 noundef %293, i64 noundef %296, i32 noundef 1, i32 noundef 0, i32 noundef %297)
          to label %298 unwind label %341

298:                                              ; preds = %287
  %299 = load i32, ptr %19, align 4, !tbaa !5
  %300 = load i32, ptr %3, align 4, !tbaa !5
  invoke void @_Z4dfs3ii(i32 noundef %299, i32 noundef %300)
          to label %301 unwind label %341

301:                                              ; preds = %298
  %302 = load i32, ptr %19, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !5
  %306 = load i32, ptr %20, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef 0, i32 noundef %305, i64 noundef %307, i32 noundef 1, i32 noundef 0, i32 noundef %308)
          to label %309 unwind label %341

309:                                              ; preds = %301
  %310 = load i32, ptr %19, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = load i32, ptr %19, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %315
  %317 = load i32, ptr %316, align 4, !tbaa !5
  %318 = add nsw i32 %317, 1
  %319 = load i32, ptr %20, align 4, !tbaa !5
  %320 = sub nsw i32 0, %319
  %321 = sext i32 %320 to i64
  %322 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef %313, i32 noundef %318, i64 noundef %321, i32 noundef 1, i32 noundef 0, i32 noundef %322)
          to label %323 unwind label %341

323:                                              ; preds = %309
  %324 = load i32, ptr %19, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %325
  %327 = load i32, ptr %326, align 4, !tbaa !5
  %328 = add nsw i32 %327, 1
  %329 = load i32, ptr @n, align 4, !tbaa !5
  %330 = load i32, ptr %20, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef %328, i32 noundef %329, i64 noundef %331, i32 noundef 1, i32 noundef 0, i32 noundef %332)
          to label %333 unwind label %341

333:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %334 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %335 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %25, i32 0, i32 0
  store ptr %334, ptr %335, align 8
  br label %336

336:                                              ; preds = %379, %333
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %337 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %338 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.5", ptr %26, i32 0, i32 0
  store ptr %337, ptr %338, align 8
  %339 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br i1 %339, label %345, label %340

340:                                              ; preds = %336
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %385

341:                                              ; preds = %323, %309, %301, %298, %287, %274, %265
  %342 = landingpad { ptr, i32 }
          cleanup
  %343 = extractvalue { ptr, i32 } %342, 0
  store ptr %343, ptr %23, align 8
  %344 = extractvalue { ptr, i32 } %342, 1
  store i32 %344, ptr %24, align 4
  br label %391

345:                                              ; preds = %336
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %346 = load i32, ptr %3, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %347
  %349 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  %350 = load i32, ptr %349, align 4, !tbaa !5
  %351 = sext i32 %350 to i64
  %352 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %348, i64 noundef %351) #5
  %353 = getelementptr inbounds %"struct.std::pair", ptr %352, i32 0, i32 0
  %354 = load i32, ptr %353, align 4, !tbaa !9
  store i32 %354, ptr %27, align 4, !tbaa !5
  %355 = load i32, ptr %27, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %356
  %358 = load i32, ptr %357, align 4, !tbaa !5
  %359 = load i32, ptr %27, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %360
  %362 = load i32, ptr %361, align 4, !tbaa !5
  %363 = add nsw i32 %362, 1
  %364 = load i32, ptr %3, align 4, !tbaa !5
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %365
  %367 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  %368 = load i32, ptr %367, align 4, !tbaa !5
  %369 = sext i32 %368 to i64
  %370 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %366, i64 noundef %369) #5
  %371 = getelementptr inbounds %"struct.std::pair", ptr %370, i32 0, i32 1
  %372 = load i32, ptr %371, align 4, !tbaa !11
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %373
  %375 = load i32, ptr %374, align 4, !tbaa !5
  %376 = sext i32 %375 to i64
  %377 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z6updateiixiii(i32 noundef %358, i32 noundef %363, i64 noundef %376, i32 noundef 1, i32 noundef 0, i32 noundef %377)
          to label %378 unwind label %381

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

379:                                              ; preds = %378
  %380 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  br label %336, !llvm.loop !17

381:                                              ; preds = %345
  %382 = landingpad { ptr, i32 }
          cleanup
  %383 = extractvalue { ptr, i32 } %382, 0
  store ptr %383, ptr %23, align 8
  %384 = extractvalue { ptr, i32 } %382, 1
  store i32 %384, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %391

385:                                              ; preds = %340
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  store i32 0, ptr %7, align 4
  br label %386

386:                                              ; preds = %385, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  %387 = load i32, ptr %7, align 4
  switch i32 %387, label %501 [
    i32 0, label %388
    i32 7, label %389
  ]

388:                                              ; preds = %386
  br label %389

389:                                              ; preds = %388, %386
  %390 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  br label %145, !llvm.loop !18

391:                                              ; preds = %381, %341, %261
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %496

392:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %393 = load i32, ptr %3, align 4, !tbaa !5
  %394 = sext i32 %393 to i64
  %395 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %394
  %396 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %395) #5
  %397 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %396, ptr %397, align 8
  br label %398

398:                                              ; preds = %493, %392
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %399 = load i32, ptr %3, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %400
  %402 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %401) #5
  %403 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %402, ptr %403, align 8
  %404 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br i1 %404, label %406, label %405

405:                                              ; preds = %398
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %495

406:                                              ; preds = %398
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %407 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #5
  %408 = getelementptr inbounds %"struct.std::pair", ptr %407, i32 0, i32 0
  %409 = load i32, ptr %408, align 4, !tbaa !9
  store i32 %409, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %410 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #5
  %411 = getelementptr inbounds %"struct.std::pair", ptr %410, i32 0, i32 1
  %412 = load i32, ptr %411, align 4, !tbaa !11
  store i32 %412, ptr %31, align 4, !tbaa !5
  %413 = load i32, ptr %31, align 4, !tbaa !5
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [262144 x i32], ptr @type, i64 0, i64 %414
  %416 = load i32, ptr %415, align 4, !tbaa !5
  %417 = icmp ne i32 %416, 0
  br i1 %417, label %418, label %473

418:                                              ; preds = %406
  %419 = load i32, ptr %30, align 4, !tbaa !5
  %420 = load i32, ptr %3, align 4, !tbaa !5
  %421 = call noundef i32 @_Z3LCAii(i32 noundef %419, i32 noundef %420)
  %422 = load i32, ptr %30, align 4, !tbaa !5
  %423 = icmp eq i32 %421, %422
  br i1 %423, label %424, label %472

424:                                              ; preds = %418
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %425 = load i32, ptr %30, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @subtree, i64 0, i64 %426
  %428 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %427) #5
  %429 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  store ptr %428, ptr %429, align 8
  %430 = load i32, ptr %30, align 4, !tbaa !5
  %431 = sext i32 %430 to i64
  %432 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @subtree, i64 0, i64 %431
  %433 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %432) #5
  %434 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %433, ptr %434, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %435 = load i32, ptr %3, align 4, !tbaa !5
  %436 = sext i32 %435 to i64
  %437 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %436
  %438 = load i32, ptr %3, align 4, !tbaa !5
  %439 = sext i32 %438 to i64
  %440 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %439
  %441 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %437, ptr noundef nonnull align 4 dereferenceable(4) %440)
  store i64 %441, ptr %35, align 4
  %442 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %33, i32 0, i32 0
  %443 = load ptr, ptr %442, align 8
  %444 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  %445 = load ptr, ptr %444, align 8
  %446 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr %443, ptr %445, ptr noundef nonnull align 4 dereferenceable(8) %35)
  %447 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %32, i32 0, i32 0
  store ptr %446, ptr %447, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  %448 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %32, i32 noundef 0) #5
  %449 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %36, i32 0, i32 0
  store ptr %448, ptr %449, align 8
  %450 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #5
  %451 = getelementptr inbounds %"struct.std::pair", ptr %450, i32 0, i32 0
  %452 = load i32, ptr %451, align 4, !tbaa !9
  %453 = load i32, ptr %31, align 4, !tbaa !5
  %454 = sext i32 %453 to i64
  %455 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %454
  %456 = load i32, ptr %455, align 4, !tbaa !5
  %457 = sub nsw i32 0, %456
  %458 = sext i32 %457 to i64
  %459 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateiixiii(i32 noundef 0, i32 noundef %452, i64 noundef %458, i32 noundef 1, i32 noundef 0, i32 noundef %459)
  %460 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %32) #5
  %461 = getelementptr inbounds %"struct.std::pair", ptr %460, i32 0, i32 1
  %462 = load i32, ptr %461, align 4, !tbaa !11
  %463 = add nsw i32 %462, 1
  %464 = load i32, ptr @n, align 4, !tbaa !5
  %465 = load i32, ptr %31, align 4, !tbaa !5
  %466 = sext i32 %465 to i64
  %467 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %466
  %468 = load i32, ptr %467, align 4, !tbaa !5
  %469 = sub nsw i32 0, %468
  %470 = sext i32 %469 to i64
  %471 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateiixiii(i32 noundef %463, i32 noundef %464, i64 noundef %470, i32 noundef 1, i32 noundef 0, i32 noundef %471)
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %472

472:                                              ; preds = %424, %418
  store i32 15, ptr %7, align 4
  br label %490

473:                                              ; preds = %406
  %474 = load i32, ptr %30, align 4, !tbaa !5
  %475 = sext i32 %474 to i64
  %476 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %475
  %477 = load i32, ptr %476, align 4, !tbaa !5
  %478 = load i32, ptr %30, align 4, !tbaa !5
  %479 = sext i32 %478 to i64
  %480 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %479
  %481 = load i32, ptr %480, align 4, !tbaa !5
  %482 = add nsw i32 %481, 1
  %483 = load i32, ptr %31, align 4, !tbaa !5
  %484 = sext i32 %483 to i64
  %485 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %484
  %486 = load i32, ptr %485, align 4, !tbaa !5
  %487 = sub nsw i32 0, %486
  %488 = sext i32 %487 to i64
  %489 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateiixiii(i32 noundef %477, i32 noundef %482, i64 noundef %488, i32 noundef 1, i32 noundef 0, i32 noundef %489)
  store i32 0, ptr %7, align 4
  br label %490

490:                                              ; preds = %473, %472
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  %491 = load i32, ptr %7, align 4
  switch i32 %491, label %501 [
    i32 0, label %492
    i32 15, label %493
  ]

492:                                              ; preds = %490
  br label %493

493:                                              ; preds = %492, %490
  %494 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #5
  br label %398, !llvm.loop !19

495:                                              ; preds = %405
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  ret void

496:                                              ; preds = %391
  %497 = load ptr, ptr %23, align 8
  %498 = load i32, ptr %24, align 4
  %499 = insertvalue { ptr, i32 } poison, ptr %497, 0
  %500 = insertvalue { ptr, i32 } %499, i32 %498, 1
  resume { ptr, i32 } %500

501:                                              ; preds = %490, %386, %258, %131
  unreachable
}

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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


; 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 }
%"struct.std::pair" = type { i32, i32 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [262144 x %"class.std::vector"], align 16
@l = external dso_local local_unnamed_addr global [262144 x i32], align 16
@r = external dso_local global [262144 x i32], align 16
@subtree = external dso_local global [262144 x %"class.std::vector"], align 16
@cost = external dso_local local_unnamed_addr global [262144 x i32], align 16
@type = external dso_local local_unnamed_addr global [262144 x i32], align 16
@tkt = external dso_local global [262144 x %"class.std::vector"], align 16
@ans = external dso_local global i64, align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiixiii(i32 noundef, i32 noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5queryv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3LCAii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #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)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4dfs3ii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.std::vector.0", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.5", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %18 = sext i32 %0 to i64
  %19 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @tkt, i64 0, i64 %18
  %20 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %21 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %21, ptr %4, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %23 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %18
  br label %31

._crit_edge:                                      ; preds = %75, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %24 = call noundef i64 @_Z5queryv()
  store i64 %24, ptr %7, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %26 = load i64, ptr %25, align 8, !tbaa !5
  store i64 %26, ptr @ans, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %27 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @g, i64 0, i64 %18
  %28 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  store ptr %28, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %29 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  store ptr %29, ptr %10, align 8
  %30 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %30, label %.lr.ph94, label %._crit_edge95

31:                                               ; preds = %.lr.ph, %75
  %32 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !13
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [262144 x i32], ptr @type, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %.not83 = icmp eq i32 %39, 0
  br i1 %.not83, label %64, label %40

40:                                               ; preds = %31
  %41 = call noundef i32 @_Z3LCAii(i32 noundef %33, i32 noundef %0)
  %42 = icmp eq i32 %41, %33
  br i1 %42, label %43, label %75

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %44 = sext i32 %33 to i64
  %45 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @subtree, i64 0, i64 %44
  %46 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #5
  %47 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %48 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %23)
  store i64 %48, ptr %6, align 8
  %49 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr %46, ptr %47, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store ptr %49, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %50 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #5
  %51 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %37
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = load i32, ptr @n, align 4, !tbaa !9
  call void @_Z6updateiixiii(i32 noundef 0, i32 noundef %52, i64 noundef %55, i32 noundef 1, i32 noundef 0, i32 noundef %56)
  %57 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %58 = getelementptr inbounds i8, ptr %57, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !13
  %60 = add nsw i32 %59, 1
  %61 = load i32, ptr @n, align 4, !tbaa !9
  %62 = load i32, ptr %53, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  call void @_Z6updateiixiii(i32 noundef %60, i32 noundef %61, i64 noundef %63, i32 noundef 1, i32 noundef 0, i32 noundef %61)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %75

64:                                               ; preds = %31
  %65 = sext i32 %33 to i64
  %66 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %65
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  %71 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %37
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = load i32, ptr @n, align 4, !tbaa !9
  call void @_Z6updateiixiii(i32 noundef %67, i32 noundef %70, i64 noundef %73, i32 noundef 1, i32 noundef 0, i32 noundef %74)
  br label %75

75:                                               ; preds = %40, %43, %64
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %77 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %77, ptr %4, align 8
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %78, label %31, label %._crit_edge, !llvm.loop !14

._crit_edge95:                                    ; preds = %219, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %79 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %79, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %80 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %80, ptr %15, align 8
  %81 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %81, label %.lr.ph97, label %._crit_edge98

.lr.ph97:                                         ; preds = %._crit_edge95
  %82 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %18
  br label %224

.lr.ph94:                                         ; preds = %._crit_edge, %219
  %83 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %84 = load i32, ptr %83, align 4, !tbaa !11
  %85 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %86 = getelementptr inbounds i8, ptr %85, i64 4
  %87 = load i32, ptr %86, align 4, !tbaa !13
  %88 = icmp eq i32 %84, %1
  br i1 %88, label %219, label %89

89:                                               ; preds = %.lr.ph94
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %93 = icmp ugt i64 %92, %91
  %94 = sext i32 %84 to i64
  br i1 %93, label %.lr.ph88, label %.thread

.lr.ph88:                                         ; preds = %89
  %95 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %94
  %96 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %94
  br label %97

97:                                               ; preds = %.lr.ph88, %.backedge
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %99) #5
  %101 = getelementptr inbounds i8, ptr %100, i64 4
  %102 = load i32, ptr %101, align 4, !tbaa !13
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [262144 x i32], ptr @type, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %.not81 = icmp eq i32 %105, 0
  %106 = load i32, ptr %8, align 4, !tbaa !9
  br i1 %.not81, label %107, label %113

107:                                              ; preds = %97
  %108 = add nsw i32 %106, 1
  store i32 %108, ptr %8, align 4, !tbaa !9
  br label %.backedge

.backedge:                                        ; preds = %119, %128, %151, %107
  %109 = phi i32 [ %121, %119 ], [ %130, %128 ], [ %153, %151 ], [ %108, %107 ]
  %110 = sext i32 %109 to i64
  %111 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %112 = icmp ugt i64 %111, %110
  br i1 %112, label %97, label %.thread, !llvm.loop !16

113:                                              ; preds = %97
  %114 = sext i32 %106 to i64
  %115 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %114) #5
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = call noundef i32 @_Z3LCAii(i32 noundef %116, i32 noundef %0)
  %118 = icmp eq i32 %117, %116
  br i1 %118, label %119, label %122

119:                                              ; preds = %113
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %8, align 4, !tbaa !9
  br label %.backedge, !llvm.loop !16

122:                                              ; preds = %113
  %123 = sext i32 %116 to i64
  %124 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = load i32, ptr %95, align 4, !tbaa !9
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %128, label %131

128:                                              ; preds = %122
  %129 = load i32, ptr %8, align 4, !tbaa !9
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %8, align 4, !tbaa !9
  br label %.backedge, !llvm.loop !16

131:                                              ; preds = %122
  %132 = load i32, ptr %96, align 4, !tbaa !9
  %133 = icmp sgt i32 %125, %132
  br i1 %133, label %.thread, label %134

134:                                              ; preds = %131
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %135 unwind label %154

135:                                              ; preds = %134
  %136 = load i32, ptr %124, align 4, !tbaa !9
  %137 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %123
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  %140 = load i32, ptr %8, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %141) #5
  %143 = getelementptr inbounds i8, ptr %142, i64 4
  %144 = load i32, ptr %143, align 4, !tbaa !13
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = sub nsw i32 0, %147
  %149 = sext i32 %148 to i64
  %150 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef %136, i32 noundef %139, i64 noundef %149, i32 noundef 1, i32 noundef 0, i32 noundef %150)
          to label %151 unwind label %154

151:                                              ; preds = %135
  %152 = load i32, ptr %8, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %8, align 4, !tbaa !9
  br label %.backedge

154:                                              ; preds = %135, %134
  %155 = landingpad { ptr, i32 }
          cleanup
  br label %223

.thread:                                          ; preds = %.backedge, %131, %89
  %156 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %94
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = sub nsw i32 0, %87
  %159 = sext i32 %158 to i64
  %160 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef 0, i32 noundef %157, i64 noundef %159, i32 noundef 1, i32 noundef 0, i32 noundef %160)
          to label %161 unwind label %189

161:                                              ; preds = %.thread
  %162 = load i32, ptr %156, align 4, !tbaa !9
  %163 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %94
  %164 = load i32, ptr %163, align 4, !tbaa !9
  %165 = add nsw i32 %164, 1
  %166 = sext i32 %87 to i64
  %167 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef %162, i32 noundef %165, i64 noundef %166, i32 noundef 1, i32 noundef 0, i32 noundef %167)
          to label %168 unwind label %189

168:                                              ; preds = %161
  %169 = load i32, ptr %163, align 4, !tbaa !9
  %170 = add nsw i32 %169, 1
  %171 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef %170, i32 noundef %171, i64 noundef %159, i32 noundef 1, i32 noundef 0, i32 noundef %171)
          to label %172 unwind label %189

172:                                              ; preds = %168
  invoke void @_Z4dfs3ii(i32 noundef %84, i32 noundef %0)
          to label %173 unwind label %189

173:                                              ; preds = %172
  %174 = load i32, ptr %156, align 4, !tbaa !9
  %175 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef 0, i32 noundef %174, i64 noundef %166, i32 noundef 1, i32 noundef 0, i32 noundef %175)
          to label %176 unwind label %189

176:                                              ; preds = %173
  %177 = load i32, ptr %156, align 4, !tbaa !9
  %178 = load i32, ptr %163, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  %180 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef %177, i32 noundef %179, i64 noundef %159, i32 noundef 1, i32 noundef 0, i32 noundef %180)
          to label %181 unwind label %189

181:                                              ; preds = %176
  %182 = load i32, ptr %163, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  %184 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef %183, i32 noundef %184, i64 noundef %166, i32 noundef 1, i32 noundef 0, i32 noundef %184)
          to label %185 unwind label %189

185:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %186 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %186, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %187 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %187, ptr %13, align 8
  %188 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br i1 %188, label %.lr.ph91, label %._crit_edge92

._crit_edge92:                                    ; preds = %213, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  br label %219

189:                                              ; preds = %181, %176, %173, %172, %168, %161, %.thread
  %190 = landingpad { ptr, i32 }
          cleanup
  br label %223

.lr.ph91:                                         ; preds = %185, %213
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %192 = load i32, ptr %191, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %193) #5
  %195 = load i32, ptr %194, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !9
  %199 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %196
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %203 = load i32, ptr %202, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %204) #5
  %206 = getelementptr inbounds i8, ptr %205, i64 4
  %207 = load i32, ptr %206, align 4, !tbaa !13
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = load i32, ptr @n, align 4, !tbaa !9
  invoke void @_Z6updateiixiii(i32 noundef %198, i32 noundef %201, i64 noundef %211, i32 noundef 1, i32 noundef 0, i32 noundef %212)
          to label %213 unwind label %217

213:                                              ; preds = %.lr.ph91
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %215 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %215, ptr %13, align 8
  %216 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br i1 %216, label %.lr.ph91, label %._crit_edge92, !llvm.loop !17

217:                                              ; preds = %.lr.ph91
  %218 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %223

219:                                              ; preds = %.lr.ph94, %._crit_edge92
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %221 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  store ptr %221, ptr %10, align 8
  %222 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %222, label %.lr.ph94, label %._crit_edge95, !llvm.loop !18

223:                                              ; preds = %217, %189, %154
  %.pn = phi { ptr, i32 } [ %218, %217 ], [ %190, %189 ], [ %155, %154 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  resume { ptr, i32 } %.pn

._crit_edge98:                                    ; preds = %271, %._crit_edge95
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  ret void

224:                                              ; preds = %.lr.ph97, %271
  %225 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %226 = load i32, ptr %225, align 4, !tbaa !11
  %227 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %228 = getelementptr inbounds i8, ptr %227, i64 4
  %229 = load i32, ptr %228, align 4, !tbaa !13
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [262144 x i32], ptr @type, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !9
  %.not = icmp eq i32 %232, 0
  br i1 %.not, label %259, label %233

233:                                              ; preds = %224
  %234 = call noundef i32 @_Z3LCAii(i32 noundef %226, i32 noundef %0)
  %235 = icmp eq i32 %234, %226
  br i1 %235, label %236, label %271

236:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  %237 = sext i32 %226 to i64
  %238 = getelementptr inbounds [262144 x %"class.std::vector"], ptr @subtree, i64 0, i64 %237
  %239 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %238) #5
  %240 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %238) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %241 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %82, ptr noundef nonnull align 4 dereferenceable(4) %82)
  store i64 %241, ptr %17, align 8
  %242 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEES3_ET_S9_S9_RKT0_(ptr %239, ptr %240, ptr noundef nonnull align 4 dereferenceable(8) %17)
  store ptr %242, ptr %16, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  %243 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #5
  %244 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %245 = load i32, ptr %244, align 4, !tbaa !11
  %246 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %230
  %247 = load i32, ptr %246, align 4, !tbaa !9
  %248 = sub nsw i32 0, %247
  %249 = sext i32 %248 to i64
  %250 = load i32, ptr @n, align 4, !tbaa !9
  call void @_Z6updateiixiii(i32 noundef 0, i32 noundef %245, i64 noundef %249, i32 noundef 1, i32 noundef 0, i32 noundef %250)
  %251 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %252 = getelementptr inbounds i8, ptr %251, i64 4
  %253 = load i32, ptr %252, align 4, !tbaa !13
  %254 = add nsw i32 %253, 1
  %255 = load i32, ptr @n, align 4, !tbaa !9
  %256 = load i32, ptr %246, align 4, !tbaa !9
  %257 = sub nsw i32 0, %256
  %258 = sext i32 %257 to i64
  call void @_Z6updateiixiii(i32 noundef %254, i32 noundef %255, i64 noundef %258, i32 noundef 1, i32 noundef 0, i32 noundef %255)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  br label %271

259:                                              ; preds = %224
  %260 = sext i32 %226 to i64
  %261 = getelementptr inbounds [262144 x i32], ptr @l, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !9
  %263 = getelementptr inbounds [262144 x i32], ptr @r, i64 0, i64 %260
  %264 = load i32, ptr %263, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  %266 = getelementptr inbounds [262144 x i32], ptr @cost, i64 0, i64 %230
  %267 = load i32, ptr %266, align 4, !tbaa !9
  %268 = sub nsw i32 0, %267
  %269 = sext i32 %268 to i64
  %270 = load i32, ptr @n, align 4, !tbaa !9
  call void @_Z6updateiixiii(i32 noundef %262, i32 noundef %265, i64 noundef %269, i32 noundef 1, i32 noundef 0, i32 noundef %270)
  br label %271

271:                                              ; preds = %233, %236, %259
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %273 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  store ptr %273, ptr %15, align 8
  %274 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %274, label %224, label %._crit_edge98, !llvm.loop !19
}

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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


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