; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Random Problems/C Parsa s Humongous Tree.ll (Z3dfsll)

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

@adj = external dso_local global %"class.std::vector", align 8
@dp = external dso_local global [2 x [100007 x i64]], align 16
@lr = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsll(i64 noundef %0, i64 noundef %1) #0 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !5
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds [100007 x i64], ptr getelementptr inbounds ([2 x [100007 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %13
  store i64 0, ptr %14, align 8, !tbaa !5
  %15 = load i64, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds [100007 x i64], ptr @dp, i64 0, i64 %15
  store i64 0, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %17 = load i64, ptr %3, align 8, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IlSaIlEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @adj, i64 noundef %17) #4
  store ptr %18, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = call ptr @_ZNSt6vectorIlSaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = call ptr @_ZNSt6vectorIlSaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  %24 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %23, ptr %24, align 8
  br label %25

25:                                               ; preds = %198, %2
  %26 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPlSt6vectorIlSaIlEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %30 = load i64, ptr %29, align 8, !tbaa !5
  store i64 %30, ptr %8, align 8, !tbaa !5
  %31 = load i64, ptr %8, align 8, !tbaa !5
  %32 = load i64, ptr %4, align 8, !tbaa !5
  %33 = icmp ne i64 %31, %32
  br i1 %33, label %34, label %197

34:                                               ; preds = %28
  %35 = load i64, ptr %8, align 8, !tbaa !5
  %36 = load i64, ptr %3, align 8, !tbaa !5
  call void @_Z3dfsll(i64 noundef %35, i64 noundef %36)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %37 = load i64, ptr %3, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %37) #4
  %39 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 0
  %40 = load i64, ptr %39, align 8, !tbaa !11
  %41 = load i64, ptr %8, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %41) #4
  %43 = getelementptr inbounds %"struct.std::pair", ptr %42, i32 0, i32 0
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = sub nsw i64 %40, %44
  %46 = icmp slt i64 %45, 0
  br i1 %46, label %47, label %58

47:                                               ; preds = %34
  %48 = load i64, ptr %3, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %48) #4
  %50 = getelementptr inbounds %"struct.std::pair", ptr %49, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = load i64, ptr %8, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %52) #4
  %54 = getelementptr inbounds %"struct.std::pair", ptr %53, i32 0, i32 0
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = sub nsw i64 %51, %55
  %57 = sub nsw i64 0, %56
  br label %68

58:                                               ; preds = %34
  %59 = load i64, ptr %3, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %59) #4
  %61 = getelementptr inbounds %"struct.std::pair", ptr %60, i32 0, i32 0
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = load i64, ptr %8, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %63) #4
  %65 = getelementptr inbounds %"struct.std::pair", ptr %64, i32 0, i32 0
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = sub nsw i64 %62, %66
  br label %68

68:                                               ; preds = %58, %47
  %69 = phi i64 [ %57, %47 ], [ %67, %58 ]
  %70 = load i64, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds [100007 x i64], ptr @dp, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = add nsw i64 %69, %72
  store i64 %73, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %74 = load i64, ptr %3, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %74) #4
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load i64, ptr %8, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %78) #4
  %80 = getelementptr inbounds %"struct.std::pair", ptr %79, i32 0, i32 1
  %81 = load i64, ptr %80, align 8, !tbaa !13
  %82 = sub nsw i64 %77, %81
  %83 = icmp slt i64 %82, 0
  br i1 %83, label %84, label %95

84:                                               ; preds = %68
  %85 = load i64, ptr %3, align 8, !tbaa !5
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %85) #4
  %87 = getelementptr inbounds %"struct.std::pair", ptr %86, i32 0, i32 0
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = load i64, ptr %8, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %89) #4
  %91 = getelementptr inbounds %"struct.std::pair", ptr %90, i32 0, i32 1
  %92 = load i64, ptr %91, align 8, !tbaa !13
  %93 = sub nsw i64 %88, %92
  %94 = sub nsw i64 0, %93
  br label %105

95:                                               ; preds = %68
  %96 = load i64, ptr %3, align 8, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %96) #4
  %98 = getelementptr inbounds %"struct.std::pair", ptr %97, i32 0, i32 0
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = load i64, ptr %8, align 8, !tbaa !5
  %101 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %100) #4
  %102 = getelementptr inbounds %"struct.std::pair", ptr %101, i32 0, i32 1
  %103 = load i64, ptr %102, align 8, !tbaa !13
  %104 = sub nsw i64 %99, %103
  br label %105

105:                                              ; preds = %95, %84
  %106 = phi i64 [ %94, %84 ], [ %104, %95 ]
  %107 = load i64, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds [100007 x i64], ptr getelementptr inbounds ([2 x [100007 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !5
  %110 = add nsw i64 %106, %109
  store i64 %110, ptr %10, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i64, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds [100007 x i64], ptr @dp, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = add nsw i64 %115, %112
  store i64 %116, ptr %114, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %117 = load i64, ptr %3, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %117) #4
  %119 = getelementptr inbounds %"struct.std::pair", ptr %118, i32 0, i32 1
  %120 = load i64, ptr %119, align 8, !tbaa !13
  %121 = load i64, ptr %8, align 8, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %121) #4
  %123 = getelementptr inbounds %"struct.std::pair", ptr %122, i32 0, i32 0
  %124 = load i64, ptr %123, align 8, !tbaa !11
  %125 = sub nsw i64 %120, %124
  %126 = icmp slt i64 %125, 0
  br i1 %126, label %127, label %138

127:                                              ; preds = %105
  %128 = load i64, ptr %3, align 8, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %128) #4
  %130 = getelementptr inbounds %"struct.std::pair", ptr %129, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !13
  %132 = load i64, ptr %8, align 8, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %132) #4
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 0
  %135 = load i64, ptr %134, align 8, !tbaa !11
  %136 = sub nsw i64 %131, %135
  %137 = sub nsw i64 0, %136
  br label %148

138:                                              ; preds = %105
  %139 = load i64, ptr %3, align 8, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %139) #4
  %141 = getelementptr inbounds %"struct.std::pair", ptr %140, i32 0, i32 1
  %142 = load i64, ptr %141, align 8, !tbaa !13
  %143 = load i64, ptr %8, align 8, !tbaa !5
  %144 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %143) #4
  %145 = getelementptr inbounds %"struct.std::pair", ptr %144, i32 0, i32 0
  %146 = load i64, ptr %145, align 8, !tbaa !11
  %147 = sub nsw i64 %142, %146
  br label %148

148:                                              ; preds = %138, %127
  %149 = phi i64 [ %137, %127 ], [ %147, %138 ]
  %150 = load i64, ptr %8, align 8, !tbaa !5
  %151 = getelementptr inbounds [100007 x i64], ptr @dp, i64 0, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !5
  %153 = add nsw i64 %149, %152
  store i64 %153, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %154 = load i64, ptr %3, align 8, !tbaa !5
  %155 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %154) #4
  %156 = getelementptr inbounds %"struct.std::pair", ptr %155, i32 0, i32 1
  %157 = load i64, ptr %156, align 8, !tbaa !13
  %158 = load i64, ptr %8, align 8, !tbaa !5
  %159 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %158) #4
  %160 = getelementptr inbounds %"struct.std::pair", ptr %159, i32 0, i32 1
  %161 = load i64, ptr %160, align 8, !tbaa !13
  %162 = sub nsw i64 %157, %161
  %163 = icmp slt i64 %162, 0
  br i1 %163, label %164, label %175

164:                                              ; preds = %148
  %165 = load i64, ptr %3, align 8, !tbaa !5
  %166 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %165) #4
  %167 = getelementptr inbounds %"struct.std::pair", ptr %166, i32 0, i32 1
  %168 = load i64, ptr %167, align 8, !tbaa !13
  %169 = load i64, ptr %8, align 8, !tbaa !5
  %170 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %169) #4
  %171 = getelementptr inbounds %"struct.std::pair", ptr %170, i32 0, i32 1
  %172 = load i64, ptr %171, align 8, !tbaa !13
  %173 = sub nsw i64 %168, %172
  %174 = sub nsw i64 0, %173
  br label %185

175:                                              ; preds = %148
  %176 = load i64, ptr %3, align 8, !tbaa !5
  %177 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %176) #4
  %178 = getelementptr inbounds %"struct.std::pair", ptr %177, i32 0, i32 1
  %179 = load i64, ptr %178, align 8, !tbaa !13
  %180 = load i64, ptr %8, align 8, !tbaa !5
  %181 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %180) #4
  %182 = getelementptr inbounds %"struct.std::pair", ptr %181, i32 0, i32 1
  %183 = load i64, ptr %182, align 8, !tbaa !13
  %184 = sub nsw i64 %179, %183
  br label %185

185:                                              ; preds = %175, %164
  %186 = phi i64 [ %174, %164 ], [ %184, %175 ]
  %187 = load i64, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds [100007 x i64], ptr getelementptr inbounds ([2 x [100007 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %187
  %189 = load i64, ptr %188, align 8, !tbaa !5
  %190 = add nsw i64 %186, %189
  store i64 %190, ptr %12, align 8, !tbaa !5
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %192 = load i64, ptr %191, align 8, !tbaa !5
  %193 = load i64, ptr %3, align 8, !tbaa !5
  %194 = getelementptr inbounds [100007 x i64], ptr getelementptr inbounds ([2 x [100007 x i64]], ptr @dp, i64 0, i64 1), i64 0, i64 %193
  %195 = load i64, ptr %194, align 8, !tbaa !5
  %196 = add nsw i64 %195, %192
  store i64 %196, ptr %194, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %197

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

198:                                              ; preds = %197
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  br label %25

200:                                              ; preds = %27
  ret void
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_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 noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEppEv(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 = { 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long>, std::allocator<std::vector<long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@adj = external dso_local global %"class.std::vector", align 8
@dp = external dso_local local_unnamed_addr global [2 x [100007 x i64]], align 16
@lr = external dso_local global %"class.std::vector.0", align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsll(i64 noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = getelementptr inbounds [100007 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 800056), i64 0, i64 %0
  store i64 0, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds [100007 x i64], ptr @dp, i64 0, i64 %0
  store i64 0, ptr %10, align 8, !tbaa !5
  %11 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IlSaIlEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @adj, i64 noundef %0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %12 = tail call ptr @_ZNSt6vectorIlSaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %12, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %13 = tail call ptr @_ZNSt6vectorIlSaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %13, ptr %4, align 8
  %14 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPlSt6vectorIlSaIlEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %14, label %.lr.ph, label %._crit_edge

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

.lr.ph:                                           ; preds = %2, %88
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %.not = icmp eq i64 %16, %1
  br i1 %.not, label %88, label %17

17:                                               ; preds = %.lr.ph
  call void @_Z3dfsll(i64 noundef %16, i64 noundef %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = icmp slt i64 %19, %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %.neg = sub nsw i64 %26, %24
  %27 = sub nsw i64 %24, %26
  %28 = select i1 %22, i64 %.neg, i64 %27
  %29 = getelementptr inbounds [100007 x i64], ptr @dp, i64 0, i64 %16
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = add nsw i64 %30, %28
  store i64 %31, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !11
  %37 = icmp slt i64 %33, %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !11
  %.neg38 = sub nsw i64 %42, %39
  %43 = sub nsw i64 %39, %42
  %44 = select i1 %37, i64 %.neg38, i64 %43
  %45 = getelementptr inbounds [100007 x i64], ptr getelementptr inbounds (i8, ptr @dp, i64 800056), i64 0, i64 %16
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = add nsw i64 %46, %44
  store i64 %47, ptr %6, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = load i64, ptr %10, align 8, !tbaa !5
  %51 = add nsw i64 %50, %49
  store i64 %51, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = icmp slt i64 %54, %56
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %.neg39 = sub nsw i64 %62, %60
  %63 = sub nsw i64 %60, %62
  %64 = select i1 %57, i64 %.neg39, i64 %63
  %65 = load i64, ptr %29, align 8, !tbaa !5
  %66 = add nsw i64 %65, %64
  store i64 %66, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = load i64, ptr %68, align 8, !tbaa !11
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %71 = getelementptr inbounds i8, ptr %70, i64 8
  %72 = load i64, ptr %71, align 8, !tbaa !11
  %73 = icmp slt i64 %69, %72
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %0) #3
  %75 = getelementptr inbounds i8, ptr %74, i64 8
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @lr, i64 noundef %16) #3
  %78 = getelementptr inbounds i8, ptr %77, i64 8
  %79 = load i64, ptr %78, align 8, !tbaa !11
  %.neg40 = sub nsw i64 %79, %76
  %80 = sub nsw i64 %76, %79
  %81 = select i1 %73, i64 %.neg40, i64 %80
  %82 = load i64, ptr %45, align 8, !tbaa !5
  %83 = add nsw i64 %82, %81
  store i64 %83, ptr %8, align 8, !tbaa !5
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = load i64, ptr %9, align 8, !tbaa !5
  %87 = add nsw i64 %86, %85
  store i64 %87, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  br label %88

88:                                               ; preds = %17, %.lr.ph
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %90 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPlSt6vectorIlSaIlEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %90, label %.lr.ph, 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IlSaIlEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEppEv(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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}


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