; LLVM IR from tangjz/acm-icpc :: codechef/SNCKPE19/PAINTREE.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 }

@sz = external dso_local global [2001 x i32], align 16
@f = external dso_local global [2001 x [2 x [2001 x i32]]], align 16
@e = external dso_local global [2001 x %"class.std::vector"], align 16
@_ZZ3dfsiiE1g = external hidden global [6 x [2001 x i64]], 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 ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  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
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @e, i64 0, i64 %19
  store ptr %20, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  br label %27

27:                                               ; preds = %43, %2
  %28 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %32 = load i32, ptr %31, align 4, !tbaa !5
  store i32 %32, ptr %9, align 4, !tbaa !5
  %33 = load i32, ptr %9, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp eq i32 %33, %34
  br i1 %35, label %36, label %37

36:                                               ; preds = %30
  store i32 3, ptr %8, align 4
  br label %40

37:                                               ; preds = %30
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %38, i32 noundef %39)
  store i32 0, ptr %8, align 4
  br label %40

40:                                               ; preds = %37, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %41 = load i32, ptr %8, align 4
  switch i32 %41, label %367 [
    i32 0, label %42
    i32 3, label %43
  ]

42:                                               ; preds = %40
  br label %43

43:                                               ; preds = %42, %40
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br label %27

45:                                               ; preds = %29
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %47
  store i32 0, ptr %48, align 4, !tbaa !5
  store i64 1, ptr @_ZZ3dfsiiE1g, align 16, !tbaa !11
  store i64 0, ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 2), align 16, !tbaa !11
  store i64 0, ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @e, i64 0, i64 %50
  store ptr %51, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %52 = load ptr, ptr %10, align 8, !tbaa !9
  %53 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #5
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #5
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %56, ptr %57, align 8
  br label %58

58:                                               ; preds = %226, %45
  %59 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br i1 %59, label %61, label %60

60:                                               ; preds = %58
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %228

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %13, align 4, !tbaa !5
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %61
  store i32 5, ptr %8, align 4
  br label %223

68:                                               ; preds = %61
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %72, %76
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = mul i64 %79, 8
  call void @llvm.memset.p0.i64(ptr align 8 getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 3), i8 0, i64 %80, i1 false)
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %84, %88
  %90 = add nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = mul i64 %91, 8
  call void @llvm.memset.p0.i64(ptr align 16 getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 4), i8 0, i64 %92, i1 false)
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = add nsw i32 %96, %100
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = mul i64 %103, 8
  call void @llvm.memset.p0.i64(ptr align 8 getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 5), i8 0, i64 %104, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %210, %68
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp sle i32 %106, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %105
  store i32 6, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %213

113:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %206, %113
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = load i32, ptr %13, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp sle i32 %115, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %114
  store i32 9, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %209

122:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %123 = load i32, ptr %13, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %124
  %126 = getelementptr inbounds [2 x [2001 x i32]], ptr %125, i64 0, i64 0
  %127 = load i32, ptr %15, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [2001 x i32], ptr %126, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %13, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %132
  %134 = getelementptr inbounds [2 x [2001 x i32]], ptr %133, i64 0, i64 1
  %135 = load i32, ptr %15, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [2001 x i32], ptr %134, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = add nsw i32 %130, %138
  store i32 %139, ptr %16, align 4, !tbaa !5
  %140 = load i32, ptr %14, align 4, !tbaa !5
  %141 = load i32, ptr %15, align 4, !tbaa !5
  %142 = add nsw i32 %140, %141
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 3), i64 0, i64 %143
  %145 = load i32, ptr %14, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !11
  %149 = load i32, ptr %16, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = mul nsw i64 %148, %150
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %144, i64 noundef %151)
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = load i32, ptr %15, align 4, !tbaa !5
  %154 = add nsw i32 %152, %153
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 4), i64 0, i64 %155
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !11
  %161 = load i32, ptr %13, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %162
  %164 = getelementptr inbounds [2 x [2001 x i32]], ptr %163, i64 0, i64 1
  %165 = load i32, ptr %15, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [2001 x i32], ptr %164, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = mul nsw i64 %160, %169
  %171 = load i32, ptr %14, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !11
  %175 = load i32, ptr %16, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = mul nsw i64 %174, %176
  %178 = add nsw i64 %170, %177
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %156, i64 noundef %178)
  %179 = load i32, ptr %14, align 4, !tbaa !5
  %180 = load i32, ptr %15, align 4, !tbaa !5
  %181 = add nsw i32 %179, %180
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 5), i64 0, i64 %182
  %184 = load i32, ptr %14, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), i64 0, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !11
  %188 = load i32, ptr %13, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %189
  %191 = getelementptr inbounds [2 x [2001 x i32]], ptr %190, i64 0, i64 1
  %192 = load i32, ptr %15, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [2001 x i32], ptr %191, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = mul nsw i64 %187, %196
  %198 = load i32, ptr %14, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 2), i64 0, i64 %199
  %201 = load i64, ptr %200, align 8, !tbaa !11
  %202 = load i32, ptr %16, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = mul nsw i64 %201, %203
  %205 = add nsw i64 %197, %204
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %183, i64 noundef %205)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %206

206:                                              ; preds = %122
  %207 = load i32, ptr %15, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %15, align 4, !tbaa !5
  br label %114, !llvm.loop !13

209:                                              ; preds = %121
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr %14, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %14, align 4, !tbaa !5
  br label %105, !llvm.loop !15

213:                                              ; preds = %112
  %214 = load i32, ptr %13, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = load i32, ptr %3, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = add nsw i32 %221, %217
  store i32 %222, ptr %220, align 4, !tbaa !5
  call void @_ZSt4swapIxLm2001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 8 dereferenceable(16008) @_ZZ3dfsiiE1g, ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 3)) #5
  call void @_ZSt4swapIxLm2001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 4)) #5
  call void @_ZSt4swapIxLm2001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 2), ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 5)) #5
  store i32 0, ptr %8, align 4
  br label %223

223:                                              ; preds = %213, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %224 = load i32, ptr %8, align 4
  switch i32 %224, label %367 [
    i32 0, label %225
    i32 5, label %226
  ]

225:                                              ; preds = %223
  br label %226

226:                                              ; preds = %225, %223
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br label %58

228:                                              ; preds = %60
  %229 = load i32, ptr %3, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %231, align 4, !tbaa !5
  %234 = load i32, ptr %3, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %235
  %237 = getelementptr inbounds [2 x [2001 x i32]], ptr %236, i64 0, i64 0
  %238 = getelementptr inbounds [2001 x i32], ptr %237, i64 0, i64 0
  %239 = load i32, ptr %3, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  %244 = sext i32 %243 to i64
  %245 = mul i64 %244, 4
  call void @llvm.memset.p0.i64(ptr align 8 %238, i8 0, i64 %245, i1 false)
  %246 = load i32, ptr %3, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %247
  %249 = getelementptr inbounds [2 x [2001 x i32]], ptr %248, i64 0, i64 1
  %250 = getelementptr inbounds [2001 x i32], ptr %249, i64 0, i64 0
  %251 = load i32, ptr %3, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = add nsw i32 %254, 1
  %256 = sext i32 %255 to i64
  %257 = mul i64 %256, 4
  call void @llvm.memset.p0.i64(ptr align 4 %250, i8 0, i64 %257, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %363, %228
  %259 = load i32, ptr %17, align 4, !tbaa !5
  %260 = load i32, ptr %3, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !5
  %264 = icmp slt i32 %259, %263
  br i1 %264, label %266, label %265

265:                                              ; preds = %258
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %366

266:                                              ; preds = %258
  %267 = load i32, ptr %17, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %268
  %270 = load i64, ptr %269, align 8, !tbaa !11
  %271 = icmp sge i64 %270, 998244353
  br i1 %271, label %272, label %279

272:                                              ; preds = %266
  %273 = load i32, ptr %17, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %274
  %276 = load i64, ptr %275, align 8, !tbaa !11
  %277 = srem i64 %276, 998244353
  store i64 %277, ptr %275, align 8, !tbaa !11
  %278 = icmp ne i64 %277, 0
  br label %279

279:                                              ; preds = %272, %266
  %280 = phi i1 [ false, %266 ], [ %278, %272 ]
  %281 = load i32, ptr %17, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), i64 0, i64 %282
  %284 = load i64, ptr %283, align 8, !tbaa !11
  %285 = icmp sge i64 %284, 998244353
  br i1 %285, label %286, label %293

286:                                              ; preds = %279
  %287 = load i32, ptr %17, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), i64 0, i64 %288
  %290 = load i64, ptr %289, align 8, !tbaa !11
  %291 = srem i64 %290, 998244353
  store i64 %291, ptr %289, align 8, !tbaa !11
  %292 = icmp ne i64 %291, 0
  br label %293

293:                                              ; preds = %286, %279
  %294 = phi i1 [ false, %279 ], [ %292, %286 ]
  %295 = load i32, ptr %17, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 2), i64 0, i64 %296
  %298 = load i64, ptr %297, align 8, !tbaa !11
  %299 = icmp sge i64 %298, 998244353
  br i1 %299, label %300, label %307

300:                                              ; preds = %293
  %301 = load i32, ptr %17, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 2), i64 0, i64 %302
  %304 = load i64, ptr %303, align 8, !tbaa !11
  %305 = srem i64 %304, 998244353
  store i64 %305, ptr %303, align 8, !tbaa !11
  %306 = icmp ne i64 %305, 0
  br label %307

307:                                              ; preds = %300, %293
  %308 = phi i1 [ false, %293 ], [ %306, %300 ]
  %309 = load i32, ptr %3, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %310
  %312 = getelementptr inbounds [2 x [2001 x i32]], ptr %311, i64 0, i64 0
  %313 = load i32, ptr %17, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [2001 x i32], ptr %312, i64 0, i64 %314
  %316 = load i32, ptr %17, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %317
  %319 = load i64, ptr %318, align 8, !tbaa !11
  %320 = trunc i64 %319 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %315, i32 noundef %320)
  %321 = load i32, ptr %17, align 4, !tbaa !5
  %322 = icmp ne i32 %321, 0
  br i1 %322, label %323, label %337

323:                                              ; preds = %307
  %324 = load i32, ptr %3, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %325
  %327 = getelementptr inbounds [2 x [2001 x i32]], ptr %326, i64 0, i64 0
  %328 = load i32, ptr %17, align 4, !tbaa !5
  %329 = sub nsw i32 %328, 1
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [2001 x i32], ptr %327, i64 0, i64 %330
  %332 = load i32, ptr %17, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 2), i64 0, i64 %333
  %335 = load i64, ptr %334, align 8, !tbaa !11
  %336 = trunc i64 %335 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %331, i32 noundef %336)
  br label %337

337:                                              ; preds = %323, %307
  %338 = load i32, ptr %3, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %339
  %341 = getelementptr inbounds [2 x [2001 x i32]], ptr %340, i64 0, i64 1
  %342 = load i32, ptr %17, align 4, !tbaa !5
  %343 = add nsw i32 %342, 1
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [2001 x i32], ptr %341, i64 0, i64 %344
  %346 = load i32, ptr %17, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %347
  %349 = load i64, ptr %348, align 8, !tbaa !11
  %350 = trunc i64 %349 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %345, i32 noundef %350)
  %351 = load i32, ptr %3, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %352
  %354 = getelementptr inbounds [2 x [2001 x i32]], ptr %353, i64 0, i64 1
  %355 = load i32, ptr %17, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds [2001 x i32], ptr %354, i64 0, i64 %356
  %358 = load i32, ptr %17, align 4, !tbaa !5
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds ([6 x [2001 x i64]], ptr @_ZZ3dfsiiE1g, i64 0, i64 1), i64 0, i64 %359
  %361 = load i64, ptr %360, align 8, !tbaa !11
  %362 = trunc i64 %361 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %357, i32 noundef %362)
  br label %363

363:                                              ; preds = %337
  %364 = load i32, ptr %17, align 4, !tbaa !5
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %17, align 4, !tbaa !5
  br label %258, !llvm.loop !16

366:                                              ; preds = %265
  ret void

367:                                              ; preds = %223, %40
  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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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 }

@sz = external dso_local local_unnamed_addr global [2001 x i32], align 16
@f = external dso_local global [2001 x [2 x [2001 x i32]]], align 16
@e = external dso_local global [2001 x %"class.std::vector"], align 16
@_ZZ3dfsiiE1g = external hidden global [6 x [2001 x i64]], 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 = sext i32 %0 to i64
  %8 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @e, i64 0, i64 %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %9 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  store ptr %9, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %10 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  store ptr %10, ptr %4, align 8
  %11 = 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) #4
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %20, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %12 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %7
  store i32 0, ptr %12, align 4, !tbaa !5
  store i64 1, ptr @_ZZ3dfsiiE1g, align 16, !tbaa !9
  store i64 0, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 32016), align 16, !tbaa !9
  store i64 0, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %13 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  store ptr %13, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %14 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  store ptr %14, ptr %6, align 8
  %15 = 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) #4
  br i1 %15, label %.lr.ph93, label %._crit_edge94

.lr.ph:                                           ; preds = %2, %20
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = icmp eq i32 %17, %1
  br i1 %18, label %20, label %19

19:                                               ; preds = %.lr.ph
  call void @_Z3dfsii(i32 noundef %17, i32 noundef %0)
  br label %20

20:                                               ; preds = %.lr.ph, %19
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %22 = 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) #4
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge94:                                    ; preds = %108, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %23 = load i32, ptr %12, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %12, align 4, !tbaa !5
  %25 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %7
  %26 = add nsw i32 %23, 2
  %27 = sext i32 %26 to i64
  %28 = shl nsw i64 %27, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %25, i8 0, i64 %28, i1 false)
  %29 = getelementptr inbounds i8, ptr %25, i64 8004
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %29, i8 0, i64 %28, i1 false)
  %30 = icmp sgt i32 %23, -1
  br i1 %30, label %.lr.ph97.preheader, label %._crit_edge98

.lr.ph97.preheader:                               ; preds = %._crit_edge94
  %31 = load i64, ptr @_ZZ3dfsiiE1g, align 16, !tbaa !9
  %32 = icmp sgt i64 %31, 998244352
  br i1 %32, label %33, label %35

33:                                               ; preds = %.lr.ph97.preheader
  %34 = urem i64 %31, 998244353
  store i64 %34, ptr @_ZZ3dfsiiE1g, align 16, !tbaa !9
  br label %35

35:                                               ; preds = %33, %.lr.ph97.preheader
  %36 = phi i64 [ %34, %33 ], [ %31, %.lr.ph97.preheader ]
  %37 = load i64, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), align 8, !tbaa !9
  %38 = icmp sgt i64 %37, 998244352
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = urem i64 %37, 998244353
  store i64 %40, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), align 8, !tbaa !9
  br label %41

41:                                               ; preds = %39, %35
  %42 = load i64, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 32016), align 16, !tbaa !9
  %43 = icmp sgt i64 %42, 998244352
  br i1 %43, label %44, label %46

44:                                               ; preds = %41
  %45 = urem i64 %42, 998244353
  store i64 %45, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 32016), align 16, !tbaa !9
  br label %46

46:                                               ; preds = %44, %41
  %47 = trunc i64 %36 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %25, i32 noundef %47)
  %.pre110 = load i64, ptr @_ZZ3dfsiiE1g, align 16, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %25, i64 8008
  %49 = trunc i64 %.pre110 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %48, i32 noundef %49)
  %50 = load i64, ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), align 8, !tbaa !9
  %51 = trunc i64 %50 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %51)
  %52 = load i32, ptr %12, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, 1
  br i1 %53, label %.lr.ph97, label %._crit_edge98

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

57:                                               ; preds = %.lr.ph93
  %58 = load i32, ptr %12, align 4, !tbaa !5
  %59 = sext i32 %55 to i64
  %60 = getelementptr inbounds [2001 x i32], ptr @sz, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add i32 %58, 1
  %63 = add i32 %62, %61
  %64 = sext i32 %63 to i64
  %65 = shl nsw i64 %64, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 48024), i8 0, i64 %65, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 64032), i8 0, i64 %65, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 80040), i8 0, i64 %65, i1 false)
  %.not8389 = icmp slt i32 %58, 0
  br i1 %.not8389, label %._crit_edge91, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %57
  %66 = getelementptr inbounds [2001 x [2 x [2001 x i32]]], ptr @f, i64 0, i64 %59
  %67 = getelementptr inbounds i8, ptr %66, i64 8004
  %68 = icmp slt i32 %61, 0
  br i1 %68, label %._crit_edge91, label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge88
  %69 = phi i32 [ %76, %._crit_edge88 ], [ %58, %.preheader.lr.ph ]
  %70 = phi i32 [ %77, %._crit_edge88 ], [ %61, %.preheader.lr.ph ]
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %._crit_edge88 ], [ 0, %.preheader.lr.ph ]
  %.not8485 = icmp slt i32 %70, 0
  br i1 %.not8485, label %._crit_edge88, label %.lr.ph87

.lr.ph87:                                         ; preds = %.preheader
  %71 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %indvars.iv102
  %72 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), i64 0, i64 %indvars.iv102
  %73 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 32016), i64 0, i64 %indvars.iv102
  br label %79

._crit_edge91:                                    ; preds = %._crit_edge88, %.preheader.lr.ph, %57
  %74 = phi i32 [ %61, %57 ], [ %61, %.preheader.lr.ph ], [ %77, %._crit_edge88 ]
  %.lcssa = phi i32 [ %58, %57 ], [ %58, %.preheader.lr.ph ], [ %76, %._crit_edge88 ]
  %75 = add nsw i32 %74, %.lcssa
  store i32 %75, ptr %12, align 4, !tbaa !5
  call void @_ZSt4swapIxLm2001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 8 dereferenceable(16008) @_ZZ3dfsiiE1g, ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 48024)) #4
  call void @_ZSt4swapIxLm2001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 64032)) #4
  call void @_ZSt4swapIxLm2001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 32016), ptr noundef nonnull align 8 dereferenceable(16008) getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 80040)) #4
  br label %108

._crit_edge88.loopexit:                           ; preds = %79
  %.pre = load i32, ptr %12, align 4, !tbaa !5
  br label %._crit_edge88

._crit_edge88:                                    ; preds = %._crit_edge88.loopexit, %.preheader
  %76 = phi i32 [ %.pre, %._crit_edge88.loopexit ], [ %69, %.preheader ]
  %77 = phi i32 [ %106, %._crit_edge88.loopexit ], [ %70, %.preheader ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %78 = sext i32 %76 to i64
  %.not83.not = icmp slt i64 %indvars.iv102, %78
  br i1 %.not83.not, label %.preheader, label %._crit_edge91, !llvm.loop !11

79:                                               ; preds = %.lr.ph87, %79
  %indvars.iv = phi i64 [ 0, %.lr.ph87 ], [ %indvars.iv.next, %79 ]
  %80 = getelementptr inbounds [2001 x i32], ptr %66, i64 0, i64 %indvars.iv
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = getelementptr inbounds [2001 x i32], ptr %67, i64 0, i64 %indvars.iv
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, %81
  %85 = add nuw nsw i64 %indvars.iv, %indvars.iv102
  %86 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 48024), i64 0, i64 %85
  %87 = load i64, ptr %71, align 8, !tbaa !9
  %88 = sext i32 %84 to i64
  %89 = mul nsw i64 %87, %88
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %86, i64 noundef %89)
  %90 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 64032), i64 0, i64 %85
  %91 = load i64, ptr %71, align 8, !tbaa !9
  %92 = load i32, ptr %82, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %91, %93
  %95 = load i64, ptr %72, align 8, !tbaa !9
  %96 = mul nsw i64 %95, %88
  %97 = add nsw i64 %94, %96
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %90, i64 noundef %97)
  %98 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 80040), i64 0, i64 %85
  %99 = load i64, ptr %72, align 8, !tbaa !9
  %100 = load i32, ptr %82, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = mul nsw i64 %99, %101
  %103 = load i64, ptr %73, align 8, !tbaa !9
  %104 = mul nsw i64 %103, %88
  %105 = add nsw i64 %102, %104
  call void @_Z7mod_incRxx(ptr noundef nonnull align 8 dereferenceable(8) %98, i64 noundef %105)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %106 = load i32, ptr %60, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %.not84.not = icmp slt i64 %indvars.iv, %107
  br i1 %.not84.not, label %79, label %._crit_edge88.loopexit, !llvm.loop !14

108:                                              ; preds = %.lr.ph93, %._crit_edge91
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %110 = 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) #4
  br i1 %110, label %.lr.ph93, label %._crit_edge94

._crit_edge98:                                    ; preds = %129, %46, %._crit_edge94
  ret void

.lr.ph97:                                         ; preds = %46, %129
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %129 ], [ 1, %46 ]
  %111 = getelementptr inbounds [2001 x i64], ptr @_ZZ3dfsiiE1g, i64 0, i64 %indvars.iv105
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = icmp sgt i64 %112, 998244352
  br i1 %113, label %114, label %116

114:                                              ; preds = %.lr.ph97
  %115 = urem i64 %112, 998244353
  store i64 %115, ptr %111, align 8, !tbaa !9
  br label %116

116:                                              ; preds = %114, %.lr.ph97
  %117 = phi i64 [ %115, %114 ], [ %112, %.lr.ph97 ]
  %118 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 16008), i64 0, i64 %indvars.iv105
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = icmp sgt i64 %119, 998244352
  br i1 %120, label %121, label %123

121:                                              ; preds = %116
  %122 = urem i64 %119, 998244353
  store i64 %122, ptr %118, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %121, %116
  %124 = getelementptr inbounds [2001 x i64], ptr getelementptr inbounds (i8, ptr @_ZZ3dfsiiE1g, i64 32016), i64 0, i64 %indvars.iv105
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = icmp sgt i64 %125, 998244352
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = urem i64 %125, 998244353
  store i64 %128, ptr %124, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %127, %123
  %130 = getelementptr inbounds [2001 x i32], ptr %25, i64 0, i64 %indvars.iv105
  %131 = trunc i64 %117 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %130, i32 noundef %131)
  %132 = add nsw i64 %indvars.iv105, -1
  %133 = getelementptr inbounds [2001 x i32], ptr %25, i64 0, i64 %132
  %134 = load i64, ptr %124, align 8, !tbaa !9
  %135 = trunc i64 %134 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %133, i32 noundef %135)
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %136 = getelementptr inbounds [2001 x i32], ptr %29, i64 0, i64 %indvars.iv.next106
  %137 = load i64, ptr %111, align 8, !tbaa !9
  %138 = trunc i64 %137 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %136, i32 noundef %138)
  %139 = getelementptr inbounds [2001 x i32], ptr %29, i64 0, i64 %indvars.iv105
  %140 = load i64, ptr %118, align 8, !tbaa !9
  %141 = trunc i64 %140 to i32
  call void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4) %139, i32 noundef %141)
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = icmp slt i64 %indvars.iv.next106, %143
  br i1 %144, label %.lr.ph97, label %._crit_edge98, !llvm.loop !15
}

; 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7mod_addRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass