; LLVM IR from tangjz/acm-icpc :: codeforces/complete/1551F.ll (Z4dfs2ii)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@f = external dso_local global [109 x [109 x i32]], align 16
@g = external dso_local global [109 x [109 x i32]], align 16
@e = external dso_local global [109 x %"class.std::vector"], align 16
@_ZZ4dfs2iiE2up = external hidden global [109 x i32], align 16
@_ZZ4dfs2iiE2dp = external hidden global [109 x [109 x i32]], align 16

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; 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: mustprogress uwtable
define dso_local void @_Z4dfs2ii(i32 noundef %0, i32 noundef %1) #4 {
  %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 i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i32, align 4
  %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
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [109 x %"class.std::vector"], ptr @e, i64 0, i64 %21
  store ptr %22, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %26 = load ptr, ptr %5, align 8, !tbaa !9
  %27 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #6
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %27, ptr %28, align 8
  br label %29

29:                                               ; preds = %97, %2
  %30 = 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) #6
  br i1 %30, label %32, label %31

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

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

38:                                               ; preds = %32
  store i32 3, ptr %8, align 4
  br label %94

39:                                               ; preds = %32
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %41
  %43 = getelementptr inbounds [109 x i32], ptr %42, i64 0, i64 0
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %45
  %47 = getelementptr inbounds [109 x i32], ptr %46, i64 0, i64 0
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = mul i64 %49, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 4 %47, i64 %50, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %88, %39
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %91

56:                                               ; preds = %51
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %58
  %60 = load i32, ptr %10, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [109 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %75

66:                                               ; preds = %56
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %68
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [109 x i32], ptr %69, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  br label %76

75:                                               ; preds = %56
  br label %76

76:                                               ; preds = %75, %66
  %77 = phi i32 [ %74, %66 ], [ 0, %75 ]
  %78 = sub nsw i32 %63, %77
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [109 x i32], ptr %81, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, %78
  store i32 %87, ptr %85, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %76
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %10, align 4, !tbaa !5
  br label %51, !llvm.loop !11

91:                                               ; preds = %55
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z4dfs2ii(i32 noundef %92, i32 noundef %93)
  store i32 0, ptr %8, align 4
  br label %94

94:                                               ; preds = %91, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %95 = load i32, ptr %8, align 4
  switch i32 %95, label %315 [
    i32 0, label %96
    i32 3, label %97
  ]

96:                                               ; preds = %94
  br label %97

97:                                               ; preds = %96, %94
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %29

99:                                               ; preds = %31
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %101
  %103 = getelementptr inbounds [109 x i32], ptr %102, i64 0, i64 0
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul i64 %105, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @_ZZ4dfs2iiE2up, ptr align 4 %103, i64 %106, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %125, %99
  %108 = load i32, ptr %11, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %128

112:                                              ; preds = %107
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %114
  %116 = getelementptr inbounds [109 x i32], ptr %115, i64 0, i64 0
  store i32 1, ptr %116, align 4, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %118
  %120 = getelementptr inbounds [109 x i32], ptr %119, i64 0, i64 0
  %121 = getelementptr inbounds i32, ptr %120, i64 1
  %122 = load i32, ptr @m, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = mul i64 %123, 4
  call void @llvm.memset.p0.i64(ptr align 4 %121, i8 0, i64 %124, i1 false)
  br label %125

125:                                              ; preds = %112
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !5
  br label %107, !llvm.loop !13

128:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %129 = load i32, ptr %3, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [109 x %"class.std::vector"], ptr @e, i64 0, i64 %130
  store ptr %131, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %132 = load ptr, ptr %12, align 8, !tbaa !9
  %133 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #6
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %135 = load ptr, ptr %12, align 8, !tbaa !9
  %136 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %135) #6
  %137 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %136, ptr %137, align 8
  br label %138

138:                                              ; preds = %236, %128
  %139 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br i1 %139, label %141, label %140

140:                                              ; preds = %138
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %238

141:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %143 = load i32, ptr %142, align 4, !tbaa !5
  store i32 %143, ptr %15, align 4, !tbaa !5
  %144 = load i32, ptr %15, align 4, !tbaa !5
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = icmp eq i32 %144, %145
  br i1 %146, label %147, label %148

147:                                              ; preds = %141
  store i32 11, ptr %8, align 4
  br label %233

148:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %229, %148
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = load i32, ptr @n, align 4, !tbaa !5
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %232

154:                                              ; preds = %149
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  %157 = load i32, ptr @n, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %159, label %173

159:                                              ; preds = %154
  %160 = load i32, ptr %15, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %161
  %163 = load i32, ptr %16, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [109 x i32], ptr %162, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = load i32, ptr %16, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sub nsw i32 %171, %166
  store i32 %172, ptr %170, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %159, %154
  %174 = load i32, ptr %15, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %175
  %177 = load i32, ptr %16, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [109 x i32], ptr %176, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %228

182:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %183 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %183, ptr %17, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %224, %182
  %185 = load i32, ptr %17, align 4, !tbaa !5
  %186 = icmp sgt i32 %185, 0
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  store i32 15, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %227

188:                                              ; preds = %184
  %189 = load i32, ptr %16, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %190
  %192 = load i32, ptr %17, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [109 x i32], ptr %191, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = load i32, ptr %16, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %198
  %200 = load i32, ptr %17, align 4, !tbaa !5
  %201 = sub nsw i32 %200, 1
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [109 x i32], ptr %199, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = load i32, ptr %15, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %207
  %209 = load i32, ptr %16, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [109 x i32], ptr %208, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = mul nsw i64 %205, %213
  %215 = add nsw i64 %196, %214
  %216 = srem i64 %215, 1000000007
  %217 = trunc i64 %216 to i32
  %218 = load i32, ptr %16, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %219
  %221 = load i32, ptr %17, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [109 x i32], ptr %220, i64 0, i64 %222
  store i32 %217, ptr %223, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %188
  %225 = load i32, ptr %17, align 4, !tbaa !5
  %226 = add nsw i32 %225, -1
  store i32 %226, ptr %17, align 4, !tbaa !5
  br label %184, !llvm.loop !14

227:                                              ; preds = %187
  br label %228

228:                                              ; preds = %227, %173
  br label %229

229:                                              ; preds = %228
  %230 = load i32, ptr %16, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %16, align 4, !tbaa !5
  br label %149, !llvm.loop !15

232:                                              ; preds = %153
  store i32 0, ptr %8, align 4
  br label %233

233:                                              ; preds = %232, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %234 = load i32, ptr %8, align 4
  switch i32 %234, label %315 [
    i32 0, label %235
    i32 11, label %236
  ]

235:                                              ; preds = %233
  br label %236

236:                                              ; preds = %235, %233
  %237 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br label %138

238:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %239

239:                                              ; preds = %311, %238
  %240 = load i32, ptr %18, align 4, !tbaa !5
  %241 = load i32, ptr @n, align 4, !tbaa !5
  %242 = icmp slt i32 %240, %241
  br i1 %242, label %244, label %243

243:                                              ; preds = %239
  store i32 18, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %314

244:                                              ; preds = %239
  %245 = load i32, ptr %18, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  %247 = load i32, ptr @n, align 4, !tbaa !5
  %248 = icmp slt i32 %246, %247
  br i1 %248, label %249, label %300

249:                                              ; preds = %244
  %250 = load i32, ptr %18, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = icmp ne i32 %254, 0
  br i1 %255, label %256, label %300

256:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %257 = load i32, ptr @m, align 4, !tbaa !5
  store i32 %257, ptr %19, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %296, %256
  %259 = load i32, ptr %19, align 4, !tbaa !5
  %260 = icmp sgt i32 %259, 0
  br i1 %260, label %262, label %261

261:                                              ; preds = %258
  store i32 21, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %299

262:                                              ; preds = %258
  %263 = load i32, ptr %18, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %264
  %266 = load i32, ptr %19, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [109 x i32], ptr %265, i64 0, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = load i32, ptr %18, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %272
  %274 = load i32, ptr %19, align 4, !tbaa !5
  %275 = sub nsw i32 %274, 1
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [109 x i32], ptr %273, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = load i32, ptr %18, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = mul nsw i64 %279, %285
  %287 = add nsw i64 %270, %286
  %288 = srem i64 %287, 1000000007
  %289 = trunc i64 %288 to i32
  %290 = load i32, ptr %18, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %291
  %293 = load i32, ptr %19, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [109 x i32], ptr %292, i64 0, i64 %294
  store i32 %289, ptr %295, align 4, !tbaa !5
  br label %296

296:                                              ; preds = %262
  %297 = load i32, ptr %19, align 4, !tbaa !5
  %298 = add nsw i32 %297, -1
  store i32 %298, ptr %19, align 4, !tbaa !5
  br label %258, !llvm.loop !16

299:                                              ; preds = %261
  br label %300

300:                                              ; preds = %299, %249, %244
  %301 = load i32, ptr @ans, align 4, !tbaa !5
  %302 = load i32, ptr %18, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %303
  %305 = load i32, ptr @m, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [109 x i32], ptr %304, i64 0, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !5
  %309 = add nsw i32 %301, %308
  %310 = srem i32 %309, 1000000007
  store i32 %310, ptr @ans, align 4, !tbaa !5
  br label %311

311:                                              ; preds = %300
  %312 = load i32, ptr %18, align 4, !tbaa !5
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %18, align 4, !tbaa !5
  br label %239, !llvm.loop !17

314:                                              ; preds = %243
  ret void

315:                                              ; preds = %233, %94
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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


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

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [109 x [109 x i32]], align 16
@g = external dso_local local_unnamed_addr global [109 x [109 x i32]], align 16
@e = external dso_local global [109 x %"class.std::vector"], align 16
@_ZZ4dfs2iiE2up = external hidden local_unnamed_addr global [109 x i32], align 16
@_ZZ4dfs2iiE2dp = external hidden local_unnamed_addr global [109 x [109 x i32]], align 16

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

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

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

; Function Attrs: mustprogress 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 #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z4dfs2ii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %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 [109 x %"class.std::vector"], ptr @e, i64 0, i64 %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %9 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %9, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %10 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  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) #5
  br i1 %11, label %.lr.ph76.preheader, label %._crit_edge77

.lr.ph76.preheader:                               ; preds = %2
  %12 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %7, i64 0
  %13 = mul nsw i64 %7, 436
  %14 = getelementptr i8, ptr @g, i64 %13
  %scevgep147 = getelementptr i8, ptr %14, i64 4
  %scevgep148 = getelementptr i8, ptr @g, i64 %13
  br label %.lr.ph76

._crit_edge77:                                    ; preds = %85, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %15 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %7
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = shl nsw i64 %17, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @_ZZ4dfs2iiE2up, ptr nonnull align 4 %15, i64 %18, i1 false)
  %19 = icmp sgt i32 %16, 0
  br i1 %19, label %.lr.ph80, label %._crit_edge81

.lr.ph80:                                         ; preds = %._crit_edge77
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = shl nsw i64 %21, 2
  %wide.trip.count108 = zext nneg i32 %16 to i64
  %xtraiter159 = and i64 %wide.trip.count108, 3
  %23 = icmp ult i32 %16, 4
  br i1 %23, label %._crit_edge81.loopexit.unr-lcssa, label %.lr.ph80.new

.lr.ph80.new:                                     ; preds = %.lr.ph80
  %unroll_iter = and i64 %wide.trip.count108, 2147483644
  br label %93

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %85
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = icmp eq i32 %25, %1
  br i1 %26, label %85, label %27

27:                                               ; preds = %.lr.ph76
  %28 = sext i32 %25 to i64
  %29 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %28
  %30 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %28
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = shl nsw i64 %32, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %29, ptr nonnull align 4 %30, i64 %33, i1 false)
  %34 = icmp sgt i32 %31, 0
  br i1 %34, label %35, label %._crit_edge

35:                                               ; preds = %27
  %wide.trip.count = zext nneg i32 %31 to i64
  %36 = load i32, ptr %12, align 4, !tbaa !5
  %37 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %28, i64 1
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %36, %38
  store i32 %39, ptr %37, align 4, !tbaa !5
  %exitcond.peel.not = icmp eq i32 %31, 1
  br i1 %exitcond.peel.not, label %._crit_edge, label %.lr.ph.peel.next.preheader

.lr.ph.peel.next.preheader:                       ; preds = %35
  %40 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %31, 9
  br i1 %min.iters.check, label %.lr.ph.peel.next.preheader158, label %vector.memcheck

.lr.ph.peel.next.preheader158:                    ; preds = %middle.block, %vector.memcheck, %.lr.ph.peel.next.preheader
  %indvars.iv.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %.lr.ph.peel.next.preheader ], [ %ind.end, %middle.block ]
  %41 = and i64 %wide.trip.count, 1
  %lcmp.mod.not.not = icmp eq i64 %41, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph.peel.next.prol, label %.lr.ph.peel.next.prol.loopexit

.lr.ph.peel.next.prol:                            ; preds = %.lr.ph.peel.next.preheader158
  %42 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %7, i64 %indvars.iv.ph
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i64 %indvars.iv.ph, -1
  %45 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %28, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sub i32 %43, %46
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.ph, 1
  %48 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %28, i64 %indvars.iv.next.prol
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %47, %49
  store i32 %50, ptr %48, align 4, !tbaa !5
  br label %.lr.ph.peel.next.prol.loopexit

.lr.ph.peel.next.prol.loopexit:                   ; preds = %.lr.ph.peel.next.prol, %.lr.ph.peel.next.preheader158
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.peel.next.preheader158 ], [ %indvars.iv.next.prol, %.lr.ph.peel.next.prol ]
  %51 = add nsw i64 %wide.trip.count, -1
  %52 = icmp eq i64 %indvars.iv.ph, %51
  br i1 %52, label %._crit_edge, label %.lr.ph.peel.next

vector.memcheck:                                  ; preds = %.lr.ph.peel.next.preheader
  %53 = mul nsw i64 %28, 436
  %scevgep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @g, i64 8), i64 %53
  %54 = shl nuw nsw i64 %wide.trip.count, 2
  %55 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @g, i64 4), i64 %53
  %scevgep146 = getelementptr i8, ptr %55, i64 %54
  %scevgep149 = getelementptr i8, ptr %scevgep148, i64 %54
  %bound0 = icmp ult ptr %scevgep, %scevgep149
  %bound1 = icmp ult ptr %scevgep147, %scevgep146
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.peel.next.preheader158, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %40, -8
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %56 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %7, i64 %offset.idx
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %wide.load = load <4 x i32>, ptr %56, align 4, !tbaa !5, !alias.scope !9
  %wide.load150 = load <4 x i32>, ptr %57, align 4, !tbaa !5, !alias.scope !9
  %58 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %28, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load151 = load <4 x i32>, ptr %58, align 4, !tbaa !5
  %wide.load152 = load <4 x i32>, ptr %59, align 4, !tbaa !5
  %60 = sub <4 x i32> %wide.load, %wide.load151
  %61 = sub <4 x i32> %wide.load150, %wide.load152
  %62 = or disjoint i64 %index, 2
  %63 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %28, i64 %62
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load153 = load <4 x i32>, ptr %63, align 4, !tbaa !5, !alias.scope !12, !noalias !9
  %wide.load154 = load <4 x i32>, ptr %64, align 4, !tbaa !5, !alias.scope !12, !noalias !9
  %65 = add nsw <4 x i32> %60, %wide.load153
  %66 = add nsw <4 x i32> %61, %wide.load154
  store <4 x i32> %65, ptr %63, align 4, !tbaa !5, !alias.scope !12, !noalias !9
  store <4 x i32> %66, ptr %64, align 4, !tbaa !5, !alias.scope !12, !noalias !9
  %index.next = add nuw i64 %index, 8
  %67 = icmp eq i64 %index.next, %n.vec
  br i1 %67, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %40, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.peel.next.preheader158

._crit_edge:                                      ; preds = %.lr.ph.peel.next.prol.loopexit, %.lr.ph.peel.next, %middle.block, %35, %27
  call void @_Z4dfs2ii(i32 noundef %25, i32 noundef %0)
  br label %85

.lr.ph.peel.next:                                 ; preds = %.lr.ph.peel.next.prol.loopexit, %.lr.ph.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph.peel.next ], [ %indvars.iv.unr, %.lr.ph.peel.next.prol.loopexit ]
  %68 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %7, i64 %indvars.iv
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i64 %indvars.iv, -1
  %71 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %28, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sub i32 %69, %72
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %28, i64 %indvars.iv.next
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %73, %75
  store i32 %76, ptr %74, align 4, !tbaa !5
  %77 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %7, i64 %indvars.iv.next
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %28, i64 %indvars.iv
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sub i32 %78, %80
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %82 = getelementptr inbounds [109 x [109 x i32]], ptr @g, i64 0, i64 %28, i64 %indvars.iv.next.1
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %81, %83
  store i32 %84, ptr %82, align 4, !tbaa !5
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph.peel.next, !llvm.loop !19

85:                                               ; preds = %.lr.ph76, %._crit_edge
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %87 = 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) #5
  br i1 %87, label %.lr.ph76, label %._crit_edge77

._crit_edge81.loopexit.unr-lcssa:                 ; preds = %93, %.lr.ph80
  %indvars.iv105.unr = phi i64 [ 0, %.lr.ph80 ], [ %indvars.iv.next106.3, %93 ]
  %lcmp.mod160.not = icmp eq i64 %xtraiter159, 0
  br i1 %lcmp.mod160.not, label %._crit_edge81, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge81.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv105.epil = phi i64 [ %indvars.iv.next106.epil, %.epil.preheader ], [ %indvars.iv105.unr, %._crit_edge81.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge81.loopexit.unr-lcssa ]
  %88 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv105.epil
  store i32 1, ptr %88, align 4, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 4
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %89, i8 0, i64 %22, i1 false)
  %indvars.iv.next106.epil = add nuw nsw i64 %indvars.iv105.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter159
  br i1 %epil.iter.cmp.not, label %._crit_edge81, label %.epil.preheader, !llvm.loop !20

._crit_edge81:                                    ; preds = %._crit_edge81.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge77
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %90 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %90, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %91 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %91, ptr %6, align 8
  %92 = 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) #5
  br i1 %92, label %.lr.ph88, label %._crit_edge89

93:                                               ; preds = %93, %.lr.ph80.new
  %indvars.iv105 = phi i64 [ 0, %.lr.ph80.new ], [ %indvars.iv.next106.3, %93 ]
  %niter = phi i64 [ 0, %.lr.ph80.new ], [ %niter.next.3, %93 ]
  %94 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv105
  store i32 1, ptr %94, align 16, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 4
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %95, i8 0, i64 %22, i1 false)
  %indvars.iv.next106 = or disjoint i64 %indvars.iv105, 1
  %96 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv.next106
  store i32 1, ptr %96, align 4, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 4
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %97, i8 0, i64 %22, i1 false)
  %indvars.iv.next106.1 = or disjoint i64 %indvars.iv105, 2
  %98 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv.next106.1
  store i32 1, ptr %98, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i64 4
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %99, i8 0, i64 %22, i1 false)
  %indvars.iv.next106.2 = or disjoint i64 %indvars.iv105, 3
  %100 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv.next106.2
  store i32 1, ptr %100, align 4, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 4
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %101, i8 0, i64 %22, i1 false)
  %indvars.iv.next106.3 = add nuw nsw i64 %indvars.iv105, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge81.loopexit.unr-lcssa, label %93, !llvm.loop !22

._crit_edge89:                                    ; preds = %.loopexit73, %._crit_edge81
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %.lr.ph96, label %227

.lr.ph96:                                         ; preds = %._crit_edge89
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %104 = load i32, ptr @m, align 4
  %.fr = freeze i32 %104
  %105 = icmp sgt i32 %.fr, 0
  %106 = sext i32 %.fr to i64
  br i1 %105, label %.lr.ph96.split.us.preheader, label %.lr.ph96.split.preheader

.lr.ph96.split.preheader:                         ; preds = %.lr.ph96
  %wide.trip.count126 = zext nneg i32 %102 to i64
  %xtraiter168 = and i64 %wide.trip.count126, 1
  %107 = icmp eq i32 %102, 1
  br i1 %107, label %._crit_edge97.loopexit155.unr-lcssa, label %.lr.ph96.split.preheader.new

.lr.ph96.split.preheader.new:                     ; preds = %.lr.ph96.split.preheader
  %unroll_iter173 = and i64 %wide.trip.count126, 2147483646
  br label %.lr.ph96.split

.lr.ph96.split.us.preheader:                      ; preds = %.lr.ph96
  %108 = zext nneg i32 %.fr to i64
  %109 = zext nneg i32 %102 to i64
  %wide.trip.count134 = zext nneg i32 %102 to i64
  %xtraiter177 = and i64 %108, 1
  %lcmp.mod178.not = icmp eq i64 %xtraiter177, 0
  %indvars.iv.next129.prol = add nsw i64 %108, -1
  %110 = icmp eq i32 %.fr, 1
  br label %.lr.ph96.split.us

.lr.ph96.split.us:                                ; preds = %.lr.ph96.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv131 = phi i64 [ 0, %.lr.ph96.split.us.preheader ], [ %indvars.iv.next132, %..loopexit_crit_edge.us ]
  %111 = phi i32 [ %ans.promoted, %.lr.ph96.split.us.preheader ], [ %149, %..loopexit_crit_edge.us ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %112 = icmp ult i64 %indvars.iv.next132, %109
  br i1 %112, label %113, label %..loopexit_crit_edge.us

113:                                              ; preds = %.lr.ph96.split.us
  %114 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %indvars.iv.next132
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %.not.us = icmp eq i32 %115, 0
  br i1 %.not.us, label %..loopexit_crit_edge.us, label %.lr.ph92.us

.lr.ph92.us:                                      ; preds = %113
  %116 = sext i32 %115 to i64
  %.phi.trans.insert138 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %108
  %.pre139 = load i32, ptr %.phi.trans.insert138, align 4, !tbaa !5
  br i1 %lcmp.mod178.not, label %.prol.loopexit176, label %.prol.loopexit176.unr-lcssa

.prol.loopexit176.unr-lcssa:                      ; preds = %.lr.ph92.us
  %117 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %108
  %118 = sext i32 %.pre139 to i64
  %119 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %indvars.iv.next129.prol
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = mul nsw i64 %121, %116
  %123 = add nsw i64 %122, %118
  %124 = srem i64 %123, 1000000007
  %125 = trunc nsw i64 %124 to i32
  store i32 %125, ptr %117, align 4, !tbaa !5
  br label %.prol.loopexit176

.prol.loopexit176:                                ; preds = %.prol.loopexit176.unr-lcssa, %.lr.ph92.us
  %.unr179 = phi i32 [ %.pre139, %.lr.ph92.us ], [ %120, %.prol.loopexit176.unr-lcssa ]
  %indvars.iv128.unr = phi i64 [ %108, %.lr.ph92.us ], [ %indvars.iv.next129.prol, %.prol.loopexit176.unr-lcssa ]
  br i1 %110, label %..loopexit_crit_edge.us, label %.lr.ph92.us.new

.lr.ph92.us.new:                                  ; preds = %.prol.loopexit176, %.lr.ph92.us.new
  %126 = phi i32 [ %139, %.lr.ph92.us.new ], [ %.unr179, %.prol.loopexit176 ]
  %indvars.iv128 = phi i64 [ %indvars.iv.next129.1, %.lr.ph92.us.new ], [ %indvars.iv128.unr, %.prol.loopexit176 ]
  %127 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %indvars.iv128
  %128 = sext i32 %126 to i64
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, -1
  %129 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %indvars.iv.next129
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = mul nsw i64 %131, %116
  %133 = add nsw i64 %132, %128
  %134 = srem i64 %133, 1000000007
  %135 = trunc nsw i64 %134 to i32
  store i32 %135, ptr %127, align 4, !tbaa !5
  %136 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %indvars.iv.next129
  %137 = sext i32 %130 to i64
  %indvars.iv.next129.1 = add nsw i64 %indvars.iv128, -2
  %138 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %indvars.iv.next129.1
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = mul nsw i64 %140, %116
  %142 = add nsw i64 %141, %137
  %143 = srem i64 %142, 1000000007
  %144 = trunc nsw i64 %143 to i32
  store i32 %144, ptr %136, align 4, !tbaa !5
  %145 = icmp sgt i64 %indvars.iv128, 2
  br i1 %145, label %.lr.ph92.us.new, label %..loopexit_crit_edge.us, !llvm.loop !23

..loopexit_crit_edge.us:                          ; preds = %.prol.loopexit176, %.lr.ph92.us.new, %113, %.lr.ph96.split.us
  %146 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv131, i64 %106
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = add nsw i32 %147, %111
  %149 = srem i32 %148, 1000000007
  %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134
  br i1 %exitcond135.not, label %._crit_edge97, label %.lr.ph96.split.us, !llvm.loop !24

.lr.ph88:                                         ; preds = %._crit_edge81, %.loopexit73
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = icmp eq i32 %151, %1
  br i1 %152, label %.loopexit73, label %.preheader

.preheader:                                       ; preds = %.lr.ph88
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = icmp sgt i32 %153, 0
  br i1 %154, label %.lr.ph86, label %.loopexit73

.lr.ph86:                                         ; preds = %.preheader
  %155 = sext i32 %151 to i64
  %156 = load i32, ptr @m, align 4
  %.fr99 = freeze i32 %156
  %157 = icmp sgt i32 %.fr99, 0
  %158 = zext nneg i32 %153 to i64
  br i1 %157, label %.lr.ph86.split.us.preheader, label %.lr.ph86.split.preheader

.lr.ph86.split.preheader:                         ; preds = %.lr.ph86
  %159 = zext nneg i32 %153 to i64
  %xtraiter161 = and i64 %158, 1
  %160 = icmp eq i32 %153, 1
  br i1 %160, label %.loopexit73.loopexit157.unr-lcssa, label %.lr.ph86.split.preheader.new

.lr.ph86.split.preheader.new:                     ; preds = %.lr.ph86.split.preheader
  %unroll_iter164 = and i64 %158, 2147483646
  br label %.lr.ph86.split

.lr.ph86.split.us.preheader:                      ; preds = %.lr.ph86
  %161 = zext nneg i32 %.fr99 to i64
  %wide.trip.count121 = zext nneg i32 %153 to i64
  %xtraiter166 = and i64 %161, 1
  %lcmp.mod167.not = icmp eq i64 %xtraiter166, 0
  %indvars.iv.next116.prol = add nsw i64 %161, -1
  %162 = icmp eq i32 %.fr99, 1
  br label %.lr.ph86.split.us

.lr.ph86.split.us:                                ; preds = %.lr.ph86.split.us.preheader, %..loopexit72_crit_edge.us
  %indvars.iv118 = phi i64 [ 0, %.lr.ph86.split.us.preheader ], [ %indvars.iv.next119, %..loopexit72_crit_edge.us ]
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %163 = icmp ult i64 %indvars.iv.next119, %158
  %164 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %155, i64 %indvars.iv118
  %165 = load i32, ptr %164, align 4, !tbaa !5
  br i1 %163, label %166, label %.lr.ph86.split.us._crit_edge

166:                                              ; preds = %.lr.ph86.split.us
  %167 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %indvars.iv.next119
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sub nsw i32 %168, %165
  store i32 %169, ptr %167, align 4, !tbaa !5
  br label %.lr.ph86.split.us._crit_edge

.lr.ph86.split.us._crit_edge:                     ; preds = %.lr.ph86.split.us, %166
  %.not70.us = icmp eq i32 %165, 0
  br i1 %.not70.us, label %..loopexit72_crit_edge.us, label %.lr.ph84.us

.lr.ph84.us:                                      ; preds = %.lr.ph86.split.us._crit_edge
  %170 = sext i32 %165 to i64
  %.phi.trans.insert136 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %161
  %.pre137 = load i32, ptr %.phi.trans.insert136, align 4, !tbaa !5
  br i1 %lcmp.mod167.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph84.us
  %171 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %161
  %172 = sext i32 %.pre137 to i64
  %173 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %indvars.iv.next116.prol
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = mul nsw i64 %175, %170
  %177 = add nsw i64 %176, %172
  %178 = srem i64 %177, 1000000007
  %179 = trunc nsw i64 %178 to i32
  store i32 %179, ptr %171, align 4, !tbaa !5
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph84.us
  %.unr = phi i32 [ %.pre137, %.lr.ph84.us ], [ %174, %.prol.loopexit.unr-lcssa ]
  %indvars.iv115.unr = phi i64 [ %161, %.lr.ph84.us ], [ %indvars.iv.next116.prol, %.prol.loopexit.unr-lcssa ]
  br i1 %162, label %..loopexit72_crit_edge.us, label %.lr.ph84.us.new

.lr.ph84.us.new:                                  ; preds = %.prol.loopexit, %.lr.ph84.us.new
  %180 = phi i32 [ %193, %.lr.ph84.us.new ], [ %.unr, %.prol.loopexit ]
  %indvars.iv115 = phi i64 [ %indvars.iv.next116.1, %.lr.ph84.us.new ], [ %indvars.iv115.unr, %.prol.loopexit ]
  %181 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %indvars.iv115
  %182 = sext i32 %180 to i64
  %indvars.iv.next116 = add nsw i64 %indvars.iv115, -1
  %183 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %indvars.iv.next116
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = mul nsw i64 %185, %170
  %187 = add nsw i64 %186, %182
  %188 = srem i64 %187, 1000000007
  %189 = trunc nsw i64 %188 to i32
  store i32 %189, ptr %181, align 4, !tbaa !5
  %190 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %indvars.iv.next116
  %191 = sext i32 %184 to i64
  %indvars.iv.next116.1 = add nsw i64 %indvars.iv115, -2
  %192 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv118, i64 %indvars.iv.next116.1
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = mul nsw i64 %194, %170
  %196 = add nsw i64 %195, %191
  %197 = srem i64 %196, 1000000007
  %198 = trunc nsw i64 %197 to i32
  store i32 %198, ptr %190, align 4, !tbaa !5
  %199 = icmp sgt i64 %indvars.iv115, 2
  br i1 %199, label %.lr.ph84.us.new, label %..loopexit72_crit_edge.us, !llvm.loop !25

..loopexit72_crit_edge.us:                        ; preds = %.prol.loopexit, %.lr.ph84.us.new, %.lr.ph86.split.us._crit_edge
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
  br i1 %exitcond122.not, label %.loopexit73, label %.lr.ph86.split.us, !llvm.loop !26

.lr.ph86.split:                                   ; preds = %.loopexit72.1, %.lr.ph86.split.preheader.new
  %indvars.iv110 = phi i64 [ 0, %.lr.ph86.split.preheader.new ], [ %indvars.iv.next111.1, %.loopexit72.1 ]
  %niter165 = phi i64 [ 0, %.lr.ph86.split.preheader.new ], [ %niter165.next.1, %.loopexit72.1 ]
  %indvars.iv.next111 = or disjoint i64 %indvars.iv110, 1
  %200 = icmp ult i64 %indvars.iv.next111, %159
  br i1 %200, label %201, label %.loopexit72

201:                                              ; preds = %.lr.ph86.split
  %202 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %155, i64 %indvars.iv110
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %indvars.iv.next111
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = sub nsw i32 %205, %203
  store i32 %206, ptr %204, align 4, !tbaa !5
  br label %.loopexit72

.loopexit72:                                      ; preds = %201, %.lr.ph86.split
  %indvars.iv.next111.1 = add nuw nsw i64 %indvars.iv110, 2
  %207 = icmp ult i64 %indvars.iv.next111.1, %159
  br i1 %207, label %208, label %.loopexit72.1

208:                                              ; preds = %.loopexit72
  %209 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %155, i64 %indvars.iv.next111
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %indvars.iv.next111.1
  %212 = load i32, ptr %211, align 8, !tbaa !5
  %213 = sub nsw i32 %212, %210
  store i32 %213, ptr %211, align 8, !tbaa !5
  br label %.loopexit72.1

.loopexit72.1:                                    ; preds = %208, %.loopexit72
  %niter165.next.1 = add i64 %niter165, 2
  %niter165.ncmp.1 = icmp eq i64 %niter165.next.1, %unroll_iter164
  br i1 %niter165.ncmp.1, label %.loopexit73.loopexit157.unr-lcssa, label %.lr.ph86.split, !llvm.loop !26

.loopexit73.loopexit157.unr-lcssa:                ; preds = %.loopexit72.1, %.lr.ph86.split.preheader
  %indvars.iv110.unr = phi i64 [ 0, %.lr.ph86.split.preheader ], [ %indvars.iv.next111.1, %.loopexit72.1 ]
  %lcmp.mod163.not = icmp eq i64 %xtraiter161, 0
  br i1 %lcmp.mod163.not, label %.loopexit73, label %.lr.ph86.split.epil

.lr.ph86.split.epil:                              ; preds = %.loopexit73.loopexit157.unr-lcssa
  %indvars.iv.next111.epil = add nuw nsw i64 %indvars.iv110.unr, 1
  %214 = icmp ult i64 %indvars.iv.next111.epil, %159
  br i1 %214, label %215, label %.loopexit73

215:                                              ; preds = %.lr.ph86.split.epil
  %216 = getelementptr inbounds [109 x [109 x i32]], ptr @f, i64 0, i64 %155, i64 %indvars.iv110.unr
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = getelementptr inbounds [109 x i32], ptr @_ZZ4dfs2iiE2up, i64 0, i64 %indvars.iv.next111.epil
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = sub nsw i32 %219, %217
  store i32 %220, ptr %218, align 4, !tbaa !5
  br label %.loopexit73

.loopexit73:                                      ; preds = %.loopexit73.loopexit157.unr-lcssa, %215, %.lr.ph86.split.epil, %..loopexit72_crit_edge.us, %.preheader, %.lr.ph88
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %222 = 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) #5
  br i1 %222, label %.lr.ph88, label %._crit_edge89

._crit_edge97.loopexit155.unr-lcssa:              ; preds = %.lr.ph96.split, %.lr.ph96.split.preheader
  %.lcssa156.ph = phi i32 [ poison, %.lr.ph96.split.preheader ], [ %236, %.lr.ph96.split ]
  %indvars.iv123.unr = phi i64 [ 0, %.lr.ph96.split.preheader ], [ %indvars.iv.next124.1, %.lr.ph96.split ]
  %.unr170 = phi i32 [ %ans.promoted, %.lr.ph96.split.preheader ], [ %236, %.lr.ph96.split ]
  %lcmp.mod171.not = icmp eq i64 %xtraiter168, 0
  br i1 %lcmp.mod171.not, label %._crit_edge97, label %.lr.ph96.split.epil

.lr.ph96.split.epil:                              ; preds = %._crit_edge97.loopexit155.unr-lcssa
  %223 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv123.unr, i64 %106
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = add nsw i32 %224, %.unr170
  %226 = srem i32 %225, 1000000007
  br label %._crit_edge97

._crit_edge97:                                    ; preds = %.lr.ph96.split.epil, %._crit_edge97.loopexit155.unr-lcssa, %..loopexit_crit_edge.us
  %.us-phi = phi i32 [ %149, %..loopexit_crit_edge.us ], [ %.lcssa156.ph, %._crit_edge97.loopexit155.unr-lcssa ], [ %226, %.lr.ph96.split.epil ]
  store i32 %.us-phi, ptr @ans, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %._crit_edge97, %._crit_edge89
  ret void

.lr.ph96.split:                                   ; preds = %.lr.ph96.split, %.lr.ph96.split.preheader.new
  %indvars.iv123 = phi i64 [ 0, %.lr.ph96.split.preheader.new ], [ %indvars.iv.next124.1, %.lr.ph96.split ]
  %228 = phi i32 [ %ans.promoted, %.lr.ph96.split.preheader.new ], [ %236, %.lr.ph96.split ]
  %niter174 = phi i64 [ 0, %.lr.ph96.split.preheader.new ], [ %niter174.next.1, %.lr.ph96.split ]
  %indvars.iv.next124 = or disjoint i64 %indvars.iv123, 1
  %229 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv123, i64 %106
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = add nsw i32 %230, %228
  %232 = srem i32 %231, 1000000007
  %indvars.iv.next124.1 = add nuw nsw i64 %indvars.iv123, 2
  %233 = getelementptr inbounds [109 x [109 x i32]], ptr @_ZZ4dfs2iiE2dp, i64 0, i64 %indvars.iv.next124, i64 %106
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = add nsw i32 %234, %232
  %236 = srem i32 %235, 1000000007
  %niter174.next.1 = add i64 %niter174, 2
  %niter174.ncmp.1 = icmp eq i64 %niter174.next.1, %unroll_iter173
  br i1 %niter174.ncmp.1, label %._crit_edge97.loopexit155.unr-lcssa, label %.lr.ph96.split, !llvm.loop !24
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10}
!10 = distinct !{!10, !11}
!11 = distinct !{!11, !"LVerDomain"}
!12 = !{!13}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !15, !16, !17, !18}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.peeled.count", i32 1}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !15, !16, !17}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}


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