; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p2279.ll (Z3dfsii)

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

@dp = external dso_local global [1010 x [5 x i32]], align 16
@G = external dso_local global [1010 x %"class.std::vector"], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %21
  %23 = getelementptr inbounds [5 x i32], ptr %22, i64 0, i64 0
  store i32 1, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #4
  store i8 0, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @G, i64 0, i64 %25
  store ptr %26, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %27 = load ptr, ptr %8, align 8, !tbaa !11
  %28 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #4
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = load ptr, ptr %8, align 8, !tbaa !11
  %31 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #4
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  br label %33

33:                                               ; preds = %63, %2
  %34 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br i1 %34, label %36, label %35

35:                                               ; preds = %33
  store i32 2, ptr %11, align 4
  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.end.p0(i64 8, ptr %8) #4
  br label %65

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %12, align 4, !tbaa !5
  %39 = load i32, ptr %12, align 4, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp eq i32 %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  store i32 3, ptr %11, align 4
  br label %60

43:                                               ; preds = %36
  store i8 1, ptr %7, align 1, !tbaa !9
  %44 = load i32, ptr %12, align 4, !tbaa !5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %44, i32 noundef %45)
  %46 = load i32, ptr %12, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %47
  %49 = getelementptr inbounds [5 x i32], ptr %48, i64 0, i64 2
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = add nsw i32 %51, %50
  store i32 %52, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr %12, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %54
  %56 = getelementptr inbounds [5 x i32], ptr %55, i64 0, i64 3
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = add nsw i32 %58, %57
  store i32 %59, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %60

60:                                               ; preds = %43, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %61 = load i32, ptr %11, align 4
  switch i32 %61, label %232 [
    i32 0, label %62
    i32 3, label %63
  ]

62:                                               ; preds = %60
  br label %63

63:                                               ; preds = %62, %60
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br label %33

65:                                               ; preds = %35
  %66 = load i8, ptr %7, align 1, !tbaa !9, !range !13, !noundef !14
  %67 = trunc i8 %66 to i1
  br i1 %67, label %81, label %68

68:                                               ; preds = %65
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %70
  %72 = getelementptr inbounds [5 x i32], ptr %71, i64 0, i64 2
  store i32 1, ptr %72, align 4, !tbaa !5
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %74
  %76 = getelementptr inbounds [5 x i32], ptr %75, i64 0, i64 1
  store i32 1, ptr %76, align 4, !tbaa !5
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %78
  %80 = getelementptr inbounds [5 x i32], ptr %79, i64 0, i64 0
  store i32 1, ptr %80, align 4, !tbaa !5
  store i32 1, ptr %11, align 4
  br label %229

81:                                               ; preds = %65
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %83
  %85 = getelementptr inbounds [5 x i32], ptr %84, i64 0, i64 0
  store i32 1, ptr %85, align 4, !tbaa !5
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %87
  %89 = getelementptr inbounds [5 x i32], ptr %88, i64 0, i64 2
  store i32 1010, ptr %89, align 4, !tbaa !5
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %91
  %93 = getelementptr inbounds [5 x i32], ptr %92, i64 0, i64 1
  store i32 1010, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @G, i64 0, i64 %95
  store ptr %96, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %97 = load ptr, ptr %13, align 8, !tbaa !11
  %98 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #4
  %99 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %100 = load ptr, ptr %13, align 8, !tbaa !11
  %101 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %100) #4
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %101, ptr %102, align 8
  br label %103

103:                                              ; preds = %196, %81
  %104 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %104, label %106, label %105

105:                                              ; preds = %103
  store i32 4, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %198

106:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %108 = load i32, ptr %107, align 4, !tbaa !5
  store i32 %108, ptr %16, align 4, !tbaa !5
  %109 = load i32, ptr %16, align 4, !tbaa !5
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = icmp eq i32 %109, %110
  br i1 %111, label %112, label %113

112:                                              ; preds = %106
  store i32 5, ptr %11, align 4
  br label %193

113:                                              ; preds = %106
  %114 = load i32, ptr %16, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %115
  %117 = getelementptr inbounds [5 x i32], ptr %116, i64 0, i64 4
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %120
  %122 = getelementptr inbounds [5 x i32], ptr %121, i64 0, i64 0
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = add nsw i32 %123, %118
  store i32 %124, ptr %122, align 4, !tbaa !5
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %126
  %128 = getelementptr inbounds [5 x i32], ptr %127, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %129 = load i32, ptr %16, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %130
  %132 = getelementptr inbounds [5 x i32], ptr %131, i64 0, i64 0
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = add nsw i32 %133, %134
  %136 = load i32, ptr %16, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %137
  %139 = getelementptr inbounds [5 x i32], ptr %138, i64 0, i64 3
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sub nsw i32 %135, %140
  store i32 %141, ptr %17, align 4, !tbaa !5
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %128, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = load i32, ptr %3, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %145
  %147 = getelementptr inbounds [5 x i32], ptr %146, i64 0, i64 1
  store i32 %143, ptr %147, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %148 = load i32, ptr %3, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %149
  %151 = getelementptr inbounds [5 x i32], ptr %150, i64 0, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %152 = load i32, ptr %16, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %153
  %155 = getelementptr inbounds [5 x i32], ptr %154, i64 0, i64 1
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = add nsw i32 %156, %157
  %159 = load i32, ptr %16, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %160
  %162 = getelementptr inbounds [5 x i32], ptr %161, i64 0, i64 2
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sub nsw i32 %158, %163
  store i32 %164, ptr %18, align 4, !tbaa !5
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %151, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = load i32, ptr %3, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %168
  %170 = getelementptr inbounds [5 x i32], ptr %169, i64 0, i64 2
  store i32 %166, ptr %170, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  %171 = load i32, ptr %16, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %172
  %174 = getelementptr inbounds [5 x i32], ptr %173, i64 0, i64 2
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = load i32, ptr %3, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %177
  %179 = getelementptr inbounds [5 x i32], ptr %178, i64 0, i64 3
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = add nsw i32 %180, %175
  store i32 %181, ptr %179, align 4, !tbaa !5
  %182 = load i32, ptr %16, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %183
  %185 = getelementptr inbounds [5 x i32], ptr %184, i64 0, i64 3
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %188
  %190 = getelementptr inbounds [5 x i32], ptr %189, i64 0, i64 4
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = add nsw i32 %191, %186
  store i32 %192, ptr %190, align 4, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %193

193:                                              ; preds = %113, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %194 = load i32, ptr %11, align 4
  switch i32 %194, label %232 [
    i32 0, label %195
    i32 5, label %196
  ]

195:                                              ; preds = %193
  br label %196

196:                                              ; preds = %195, %193
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br label %103

198:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %225, %198
  %200 = load i32, ptr %19, align 4, !tbaa !5
  %201 = icmp sle i32 %200, 4
  br i1 %201, label %203, label %202

202:                                              ; preds = %199
  store i32 6, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %228

203:                                              ; preds = %199
  %204 = load i32, ptr %3, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %205
  %207 = load i32, ptr %19, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [5 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %3, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %211
  %213 = load i32, ptr %19, align 4, !tbaa !5
  %214 = sub nsw i32 %213, 1
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [5 x i32], ptr %212, i64 0, i64 %215
  %217 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %209, ptr noundef nonnull align 4 dereferenceable(4) %216)
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = load i32, ptr %3, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %220
  %222 = load i32, ptr %19, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [5 x i32], ptr %221, i64 0, i64 %223
  store i32 %218, ptr %224, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %203
  %226 = load i32, ptr %19, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %19, align 4, !tbaa !5
  br label %199, !llvm.loop !15

228:                                              ; preds = %202
  store i32 0, ptr %11, align 4
  br label %229

229:                                              ; preds = %228, %68
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %230 = load i32, ptr %11, align 4
  switch i32 %230, label %232 [
    i32 0, label %231
    i32 1, label %231
  ]

231:                                              ; preds = %229, %229
  ret void

232:                                              ; preds = %229, %193, %60
  unreachable
}

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

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

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

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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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

@dp = external dso_local global [1010 x [5 x i32]], align 16
@G = external dso_local global [1010 x %"class.std::vector"], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsii(i32 noundef %0, i32 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 %"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 = sext i32 %0 to i64
  %10 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %9
  store i32 1, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @G, i64 0, i64 %9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %12 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(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 @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %13, ptr %4, align 8
  %14 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_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.thread

._crit_edge.thread:                               ; preds = %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
  br label %30

._crit_edge:                                      ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %.151, label %33, label %30

.lr.ph:                                           ; preds = %2, %27
  %.04757 = phi i32 [ %.1, %27 ], [ 0, %2 ]
  %.04856 = phi i32 [ %.149, %27 ], [ 0, %2 ]
  %.05055 = phi i1 [ %.151, %27 ], [ false, %2 ]
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp eq i32 %16, %1
  br i1 %17, label %27, label %18

18:                                               ; preds = %.lr.ph
  call void @_Z3dfsii(i32 noundef %16, i32 noundef %0)
  %19 = sext i32 %16 to i64
  %20 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %19
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = add nsw i32 %22, %.04757
  %24 = getelementptr inbounds i8, ptr %20, i64 12
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %25, %.04856
  br label %27

27:                                               ; preds = %.lr.ph, %18
  %.151 = phi i1 [ true, %18 ], [ %.05055, %.lr.ph ]
  %.149 = phi i32 [ %26, %18 ], [ %.04856, %.lr.ph ]
  %.1 = phi i32 [ %23, %18 ], [ %.04757, %.lr.ph ]
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %29, label %.lr.ph, label %._crit_edge

30:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %31 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 1, ptr %31, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 1, ptr %32, align 4, !tbaa !5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %.loopexit

33:                                               ; preds = %._crit_edge
  store i32 1, ptr %10, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 1010, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 1010, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %36 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %36, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %37 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  store ptr %37, ptr %6, align 8
  %38 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  br i1 %38, label %.lr.ph61, label %._crit_edge62

.lr.ph61:                                         ; preds = %33
  %39 = getelementptr inbounds i8, ptr %10, i64 12
  %40 = getelementptr inbounds i8, ptr %10, i64 16
  br label %53

._crit_edge62:                                    ; preds = %85, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  %41 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %9, i64 1
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %41, align 4, !tbaa !5
  %44 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %9, i64 2
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %46 = load i32, ptr %45, align 4, !tbaa !5
  store i32 %46, ptr %44, align 4, !tbaa !5
  %47 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %9, i64 3
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %47, ptr noundef nonnull align 4 dereferenceable(4) %44)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  store i32 %49, ptr %47, align 4, !tbaa !5
  %50 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %9, i64 4
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %50, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr %50, align 4, !tbaa !5
  br label %.loopexit

53:                                               ; preds = %.lr.ph61, %85
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %55, %1
  br i1 %56, label %85, label %57

57:                                               ; preds = %53
  %58 = sext i32 %55 to i64
  %59 = getelementptr inbounds [1010 x [5 x i32]], ptr @dp, i64 0, i64 %58
  %60 = getelementptr inbounds i8, ptr %59, i64 16
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %10, align 4, !tbaa !5
  %63 = add nsw i32 %62, %61
  store i32 %63, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %64 = load i32, ptr %59, align 4, !tbaa !5
  %65 = add nsw i32 %64, %.149
  %66 = getelementptr inbounds i8, ptr %59, i64 12
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sub i32 %65, %67
  store i32 %68, ptr %7, align 4, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %71 = getelementptr inbounds i8, ptr %59, i64 4
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = add nsw i32 %72, %.1
  %74 = getelementptr inbounds i8, ptr %59, i64 8
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sub i32 %73, %75
  store i32 %76, ptr %8, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  %79 = load i32, ptr %74, align 4, !tbaa !5
  %80 = load i32, ptr %39, align 4, !tbaa !5
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr %39, align 4, !tbaa !5
  %82 = load i32, ptr %66, align 4, !tbaa !5
  %83 = load i32, ptr %40, align 4, !tbaa !5
  %84 = add nsw i32 %83, %82
  store i32 %84, ptr %40, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %53, %57
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %87 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  br i1 %87, label %53, label %._crit_edge62

.loopexit:                                        ; preds = %._crit_edge62, %30
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(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_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_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 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) 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_iteratorIPiSt6vectorIiSaIiEEEppEv(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 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass