; LLVM IR from tangjz/acm-icpc :: codeforces/complete (512D)

; 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
@c = external dso_local global [101 x [101 x i32]], align 16
@inv = external dso_local global [101 x i32], align 16
@f = external dso_local global [101 x [101 x i32]], align 16
@tmp = external dso_local global [101 x i32], align 16
@ans = external dso_local global [101 x i32], align 16
@e = external dso_local global [101 x %"class.std::vector"], align 16
@seq = external dso_local global %"class.std::vector", align 8
@vis = external dso_local global [101 x i8], align 16
@val = external dso_local global [101 x i8], align 16
@m = external dso_local global i32, align 4
@u = external dso_local global [10001 x i32], align 16
@v = external dso_local global [10001 x i32], align 16
@deg = external dso_local global [101 x i32], align 16
@que = external dso_local global [101 x i32], align 16
@l = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5mergePiS_(ptr noundef, ptr noundef) #0

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

; 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 void @_Z4combPiS_(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3pfsiib(i32 noundef, i32 noundef, i1 noundef zeroext) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  store i32 1, ptr getelementptr inbounds ([101 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %43, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %46

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sdiv i32 1000000009, %27
  %29 = sub nsw i32 1000000009, %28
  %30 = sext i32 %29 to i64
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = srem i32 1000000009, %31
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = mul nsw i64 %30, %36
  %38 = srem i64 %37, 1000000009
  %39 = trunc i64 %38 to i32
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %26
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

46:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %115, %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %118

52:                                               ; preds = %47
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %54
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [101 x i32], ptr %55, i64 0, i64 %57
  store i32 1, ptr %58, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %60
  %62 = getelementptr inbounds [101 x i32], ptr %61, i64 0, i64 0
  store i32 1, ptr %62, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %111, %52
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %63
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %71
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [101 x i32], ptr %72, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %80
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [101 x i32], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %77, %85
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [101 x i32], ptr %89, i64 0, i64 %91
  store i32 %86, ptr %92, align 4, !tbaa !5
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %94
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [101 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp sge i32 %99, 1000000009
  br i1 %100, label %101, label %110

101:                                              ; preds = %68
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %103
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [101 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1000000009
  store i32 %109, ptr %107, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %101, %68
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %5, align 4, !tbaa !5
  br label %63, !llvm.loop !11

114:                                              ; preds = %67
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %3, align 4, !tbaa !5
  br label %47, !llvm.loop !12

118:                                              ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %166, %118
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr @m, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

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

124:                                              ; preds = %119
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr @u, i64 %126
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr @v, i64 %129
  %131 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %127, ptr noundef %130)
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %137, align 4, !tbaa !5
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %145, align 4, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %152
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %155
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %153, ptr noundef nonnull align 4 dereferenceable(4) %156)
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %161
  %163 = load i32, ptr %6, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %164
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %162, ptr noundef nonnull align 4 dereferenceable(4) %165)
  br label %166

166:                                              ; preds = %124
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %6, align 4, !tbaa !5
  br label %119, !llvm.loop !13

169:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %191, %169
  %171 = load i32, ptr %7, align 4, !tbaa !5
  %172 = load i32, ptr @n, align 4, !tbaa !5
  %173 = icmp sle i32 %171, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %170
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %194

175:                                              ; preds = %170
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = icmp sle i32 %179, 1
  br i1 %180, label %181, label %190

181:                                              ; preds = %175
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = load i32, ptr @r, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr @r, align 4, !tbaa !5
  %185 = sext i32 %183 to i64
  %186 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %185
  store i32 %182, ptr %186, align 4, !tbaa !5
  %187 = load i32, ptr %7, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %188
  store i8 1, ptr %189, align 1, !tbaa !14
  br label %190

190:                                              ; preds = %181, %175
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %7, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %7, align 4, !tbaa !5
  br label %170, !llvm.loop !16

194:                                              ; preds = %174
  br label %195

195:                                              ; preds = %257, %194
  %196 = load i32, ptr @l, align 4, !tbaa !5
  %197 = load i32, ptr @r, align 4, !tbaa !5
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %199, label %258

199:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %200 = load i32, ptr @l, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr @l, align 4, !tbaa !5
  %202 = sext i32 %200 to i64
  %203 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  store i32 %204, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %205 = load i32, ptr %8, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %206
  %208 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %207) #7
  %209 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %208, ptr %209, align 8
  br label %210

210:                                              ; preds = %255, %199
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %211 = load i32, ptr %8, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %212
  %214 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %213) #7
  %215 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %214, ptr %215, align 8
  %216 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br i1 %216, label %218, label %217

217:                                              ; preds = %210
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %257

218:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  store ptr %219, ptr %11, align 8, !tbaa !17
  %220 = load ptr, ptr %11, align 8, !tbaa !17
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %222
  %224 = load i8, ptr %223, align 1, !tbaa !14, !range !19, !noundef !20
  %225 = trunc i8 %224 to i1
  br i1 %225, label %226, label %227

226:                                              ; preds = %218
  store i32 21, ptr %4, align 4
  br label %252

227:                                              ; preds = %218
  %228 = load ptr, ptr %11, align 8, !tbaa !17
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [101 x i32], ptr @deg, 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 ptr, ptr %11, align 8, !tbaa !17
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = icmp sle i32 %238, 1
  br i1 %239, label %240, label %251

240:                                              ; preds = %227
  %241 = load ptr, ptr %11, align 8, !tbaa !17
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = load i32, ptr @r, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr @r, align 4, !tbaa !5
  %245 = sext i32 %243 to i64
  %246 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %245
  store i32 %242, ptr %246, align 4, !tbaa !5
  %247 = load ptr, ptr %11, align 8, !tbaa !17
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %249
  store i8 1, ptr %250, align 1, !tbaa !14
  br label %251

251:                                              ; preds = %240, %227
  store i32 0, ptr %4, align 4
  br label %252

252:                                              ; preds = %251, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %253 = load i32, ptr %4, align 4
  switch i32 %253, label %418 [
    i32 0, label %254
    i32 21, label %255
  ]

254:                                              ; preds = %252
  br label %255

255:                                              ; preds = %254, %252
  %256 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %210, !llvm.loop !21

257:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %195, !llvm.loop !22

258:                                              ; preds = %195
  store i32 1, ptr @ans, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %259

259:                                              ; preds = %325, %258
  %260 = load i32, ptr %12, align 4, !tbaa !5
  %261 = load i32, ptr @m, align 4, !tbaa !5
  %262 = icmp slt i32 %260, %261
  br i1 %262, label %264, label %263

263:                                              ; preds = %259
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %328

264:                                              ; preds = %259
  %265 = load i32, ptr %12, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %266
  %268 = load i32, ptr %267, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %269
  %271 = load i8, ptr %270, align 1, !tbaa !14, !range !19, !noundef !20
  %272 = trunc i8 %271 to i1
  %273 = zext i1 %272 to i32
  %274 = load i32, ptr %12, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %278
  %280 = load i8, ptr %279, align 1, !tbaa !14, !range !19, !noundef !20
  %281 = trunc i8 %280 to i1
  %282 = zext i1 %281 to i32
  %283 = icmp ne i32 %273, %282
  br i1 %283, label %284, label %324

284:                                              ; preds = %264
  %285 = load i32, ptr %12, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %289
  %291 = load i8, ptr %290, align 1, !tbaa !14, !range !19, !noundef !20
  %292 = trunc i8 %291 to i1
  br i1 %292, label %293, label %300

293:                                              ; preds = %284
  %294 = load i32, ptr %12, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %295
  %297 = load i32, ptr %12, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %298
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %296, ptr noundef nonnull align 4 dereferenceable(4) %299) #7
  br label %300

300:                                              ; preds = %293, %284
  %301 = load i32, ptr %12, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %302
  %304 = load i32, ptr %303, align 4, !tbaa !5
  %305 = load i32, ptr %12, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !5
  call void @_Z3pfsiib(i32 noundef %304, i32 noundef %308, i1 noundef zeroext false)
  %309 = load i32, ptr %12, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %310
  %312 = load i32, ptr %311, align 4, !tbaa !5
  %313 = load i32, ptr %12, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %314
  %316 = load i32, ptr %315, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %312, i32 noundef %316)
  %317 = load i32, ptr %12, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %318
  %320 = load i32, ptr %319, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %321
  %323 = getelementptr inbounds [101 x i32], ptr %322, i64 0, i64 0
  call void @_Z5mergePiS_(ptr noundef @ans, ptr noundef %323)
  br label %324

324:                                              ; preds = %300, %264
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %12, align 4, !tbaa !5
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %12, align 4, !tbaa !5
  br label %259, !llvm.loop !23

328:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %329

329:                                              ; preds = %399, %328
  %330 = load i32, ptr %13, align 4, !tbaa !5
  %331 = load i32, ptr @n, align 4, !tbaa !5
  %332 = icmp sle i32 %330, %331
  br i1 %332, label %334, label %333

333:                                              ; preds = %329
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %402

334:                                              ; preds = %329
  %335 = load i32, ptr %13, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %336
  %338 = load i8, ptr %337, align 1, !tbaa !14, !range !19, !noundef !20
  %339 = trunc i8 %338 to i1
  br i1 %339, label %340, label %398

340:                                              ; preds = %334
  %341 = load i32, ptr %13, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %342
  %344 = load i8, ptr %343, align 1, !tbaa !14, !range !19, !noundef !20
  %345 = trunc i8 %344 to i1
  br i1 %345, label %398, label %346

346:                                              ; preds = %340
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  call void @llvm.memset.p0.i64(ptr align 16 @tmp, i8 0, i64 404, i1 false)
  %347 = load i32, ptr %13, align 4, !tbaa !5
  call void @_Z3pfsiib(i32 noundef %347, i32 noundef -1, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %348 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  %349 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %348, ptr %349, align 8
  br label %350

350:                                              ; preds = %364, %346
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %351 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  %352 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %351, ptr %352, align 8
  %353 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br i1 %353, label %355, label %354

354:                                              ; preds = %350
  store i32 28, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %366

355:                                              ; preds = %350
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %356 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  store ptr %356, ptr %16, align 8, !tbaa !17
  %357 = load ptr, ptr %16, align 8, !tbaa !17
  %358 = load i32, ptr %357, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %358, i32 noundef -1)
  %359 = load ptr, ptr %16, align 8, !tbaa !17
  %360 = load i32, ptr %359, align 4, !tbaa !5
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %361
  %363 = getelementptr inbounds [101 x i32], ptr %362, i64 0, i64 0
  call void @_Z4combPiS_(ptr noundef @tmp, ptr noundef %363)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %364

364:                                              ; preds = %355
  %365 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br label %350, !llvm.loop !24

366:                                              ; preds = %354
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %367 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  %368 = trunc i64 %367 to i32
  store i32 %368, ptr %18, align 4, !tbaa !5
  br label %369

369:                                              ; preds = %394, %366
  %370 = load i32, ptr %17, align 4, !tbaa !5
  %371 = load i32, ptr %18, align 4, !tbaa !5
  %372 = sub nsw i32 %371, 1
  %373 = icmp slt i32 %370, %372
  br i1 %373, label %375, label %374

374:                                              ; preds = %369
  store i32 31, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %397

375:                                              ; preds = %369
  %376 = load i32, ptr %17, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [101 x i32], ptr @tmp, i64 0, i64 %377
  %379 = load i32, ptr %378, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = load i32, ptr %18, align 4, !tbaa !5
  %382 = load i32, ptr %17, align 4, !tbaa !5
  %383 = sub nsw i32 %381, %382
  %384 = sext i32 %383 to i64
  %385 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %384
  %386 = load i32, ptr %385, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = mul nsw i64 %380, %387
  %389 = srem i64 %388, 1000000009
  %390 = trunc i64 %389 to i32
  %391 = load i32, ptr %17, align 4, !tbaa !5
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [101 x i32], ptr @tmp, i64 0, i64 %392
  store i32 %390, ptr %393, align 4, !tbaa !5
  br label %394

394:                                              ; preds = %375
  %395 = load i32, ptr %17, align 4, !tbaa !5
  %396 = add nsw i32 %395, 1
  store i32 %396, ptr %17, align 4, !tbaa !5
  br label %369, !llvm.loop !25

397:                                              ; preds = %374
  call void @_Z5mergePiS_(ptr noundef @ans, ptr noundef @tmp)
  br label %398

398:                                              ; preds = %397, %340, %334
  br label %399

399:                                              ; preds = %398
  %400 = load i32, ptr %13, align 4, !tbaa !5
  %401 = add nsw i32 %400, 1
  store i32 %401, ptr %13, align 4, !tbaa !5
  br label %329, !llvm.loop !26

402:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %403

403:                                              ; preds = %414, %402
  %404 = load i32, ptr %19, align 4, !tbaa !5
  %405 = load i32, ptr @n, align 4, !tbaa !5
  %406 = icmp sle i32 %404, %405
  br i1 %406, label %408, label %407

407:                                              ; preds = %403
  store i32 34, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %417

408:                                              ; preds = %403
  %409 = load i32, ptr %19, align 4, !tbaa !5
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [101 x i32], ptr @ans, i64 0, i64 %410
  %412 = load i32, ptr %411, align 4, !tbaa !5
  %413 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %412)
  br label %414

414:                                              ; preds = %408
  %415 = load i32, ptr %19, align 4, !tbaa !5
  %416 = add nsw i32 %415, 1
  store i32 %416, ptr %19, align 4, !tbaa !5
  br label %403, !llvm.loop !27

417:                                              ; preds = %407
  ret i32 0

418:                                              ; preds = %252
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #6

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

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

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

declare i32 @printf(ptr noundef, ...) #6

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress norecurse 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 #6 = { "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 #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}


; 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 global i32, align 4
@c = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@inv = external dso_local local_unnamed_addr global [101 x i32], align 16
@f = external dso_local global [101 x [101 x i32]], align 16
@tmp = external dso_local global [101 x i32], align 16
@ans = external dso_local global [101 x i32], align 16
@e = external dso_local global [101 x %"class.std::vector"], align 16
@seq = external dso_local global %"class.std::vector", align 8
@vis = external dso_local local_unnamed_addr global [101 x i8], align 16
@val = external dso_local local_unnamed_addr global [101 x i8], align 16
@m = external dso_local global i32, align 4
@u = external dso_local global [10001 x i32], align 16
@v = external dso_local global [10001 x i32], align 16
@deg = external dso_local local_unnamed_addr global [101 x i32], align 16
@que = external dso_local local_unnamed_addr global [101 x i32], align 16
@l = external dso_local local_unnamed_addr global i32, align 4
@r = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5mergePiS_(ptr noundef, ptr noundef) local_unnamed_addr #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 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 void @_Z4combPiS_(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3pfsiib(i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

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

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not93 = icmp slt i32 %6, 2
  br i1 %.not93, label %.preheader92, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %7 = add nuw i32 %6, 1
  %wide.trip.count = zext i32 %7 to i64
  br label %.lr.ph

.preheader92:                                     ; preds = %.lr.ph, %0
  %.not8397 = icmp slt i32 %6, 0
  br i1 %.not8397, label %.preheader91, label %.lr.ph99.preheader

.lr.ph99.preheader:                               ; preds = %.preheader92
  %8 = add nuw i32 %6, 1
  %wide.trip.count136 = zext i32 %8 to i64
  br label %.lr.ph99

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 2, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %9 = trunc nuw nsw i64 %indvars.iv to i32
  %10 = udiv i32 1000000009, %9
  %11 = sub nuw nsw i32 1000000009, %10
  %12 = zext nneg i32 %11 to i64
  %13 = urem i32 1000000009, %9
  %14 = zext nneg i32 %13 to i64
  %15 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = mul nsw i64 %17, %12
  %19 = srem i64 %18, 1000000009
  %20 = trunc nsw i64 %19 to i32
  %21 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %indvars.iv
  store i32 %20, ptr %21, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader92, label %.lr.ph, !llvm.loop !9

.preheader91:                                     ; preds = %._crit_edge, %.preheader92
  %22 = load i32, ptr @m, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph101, label %.preheader90

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %._crit_edge
  %indvars.iv133 = phi i64 [ 0, %.lr.ph99.preheader ], [ %indvars.iv.next134, %._crit_edge ]
  %24 = add nsw i64 %indvars.iv133, -1
  %25 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %indvars.iv133
  %26 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %indvars.iv133, i64 %indvars.iv133
  store i32 1, ptr %26, align 4, !tbaa !5
  store i32 1, ptr %25, align 4, !tbaa !5
  %27 = icmp ugt i64 %indvars.iv133, 1
  br i1 %27, label %.lr.ph96, label %._crit_edge

.lr.ph96:                                         ; preds = %.lr.ph99
  %28 = add nsw i64 %indvars.iv133, -1
  %.phi.trans.insert = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %28, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %min.iters.check = icmp eq i64 %indvars.iv133, 2
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph96
  %.ph = phi i32 [ %.pre, %.lr.ph96 ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv128.ph = phi i64 [ 1, %.lr.ph96 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph96
  %n.vec = and i64 %24, -2
  %ind.end = or i64 %24, 1
  %vector.recur.init = insertelement <2 x i32> poison, i32 %.pre, i64 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <2 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %29 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %28, i64 %offset.idx
  %wide.load = load <2 x i32>, ptr %29, align 4, !tbaa !5
  %30 = shufflevector <2 x i32> %vector.recur, <2 x i32> %wide.load, <2 x i32> <i32 1, i32 2>
  %31 = add nsw <2 x i32> %wide.load, %30
  %32 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %indvars.iv133, i64 %offset.idx
  %33 = icmp sgt <2 x i32> %31, <i32 1000000008, i32 1000000008>
  %34 = add nsw <2 x i32> %31, <i32 -1000000009, i32 -1000000009>
  %35 = select <2 x i1> %33, <2 x i32> %34, <2 x i32> %31
  store <2 x i32> %35, ptr %32, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 2
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %vector.recur.extract = extractelement <2 x i32> %wide.load, i64 1
  %cmp.n = icmp eq i64 %24, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.lr.ph99
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
  br i1 %exitcond137.not, label %.preheader91, label %.lr.ph99, !llvm.loop !14

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %37 = phi i32 [ %39, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %scalar.ph ], [ %indvars.iv128.ph, %scalar.ph.preheader ]
  %38 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %28, i64 %indvars.iv128
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %39, %37
  %41 = getelementptr inbounds [101 x [101 x i32]], ptr @c, i64 0, i64 %indvars.iv133, i64 %indvars.iv128
  %42 = icmp sgt i32 %40, 1000000008
  %43 = add nsw i32 %40, -1000000009
  %spec.select = select i1 %42, i32 %43, i32 %40
  store i32 %spec.select, ptr %41, align 4, !tbaa !5
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond132.not = icmp eq i64 %indvars.iv.next129, %indvars.iv133
  br i1 %exitcond132.not, label %._crit_edge, label %scalar.ph, !llvm.loop !15

.preheader90.loopexit:                            ; preds = %.lr.ph101
  %.pre160 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader90

.preheader90:                                     ; preds = %.preheader90.loopexit, %.preheader91
  %44 = phi i32 [ %65, %.preheader90.loopexit ], [ %22, %.preheader91 ]
  %45 = phi i32 [ %.pre160, %.preheader90.loopexit ], [ %6, %.preheader91 ]
  %r.promoted = load i32, ptr @r, align 4, !tbaa !5
  %.not84102 = icmp slt i32 %45, 1
  br i1 %.not84102, label %.preheader89, label %.lr.ph104.preheader

.lr.ph104.preheader:                              ; preds = %.preheader90
  %46 = zext nneg i32 %45 to i64
  %xtraiter = and i64 %46, 1
  %47 = icmp eq i32 %45, 1
  br i1 %47, label %.preheader89.loopexit.unr-lcssa, label %.lr.ph104.preheader.new

.lr.ph104.preheader.new:                          ; preds = %.lr.ph104.preheader
  %unroll_iter = and i64 %46, 2147483646
  br label %.lr.ph104

.lr.ph101:                                        ; preds = %.preheader91, %.lr.ph101
  %indvars.iv138 = phi i64 [ %indvars.iv.next139, %.lr.ph101 ], [ 0, %.preheader91 ]
  %48 = getelementptr inbounds i32, ptr @u, i64 %indvars.iv138
  %49 = getelementptr inbounds i32, ptr @v, i64 %indvars.iv138
  %50 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %48, ptr noundef nonnull %49)
  %51 = load i32, ptr %48, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !5
  %56 = load i32, ptr %49, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %58, align 4, !tbaa !5
  %61 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %52
  tail call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 4 dereferenceable(4) %49)
  %62 = load i32, ptr %49, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %63
  tail call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next139, %66
  br i1 %67, label %.lr.ph101, label %.preheader90.loopexit, !llvm.loop !16

.preheader89.loopexit.unr-lcssa:                  ; preds = %100, %.lr.ph104.preheader
  %.lcssa170.ph = phi i32 [ poison, %.lr.ph104.preheader ], [ %101, %100 ]
  %indvars.iv141.unr = phi i64 [ 1, %.lr.ph104.preheader ], [ %indvars.iv.next142.1, %100 ]
  %.unr = phi i32 [ %r.promoted, %.lr.ph104.preheader ], [ %101, %100 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader89, label %.lr.ph104.epil

.lr.ph104.epil:                                   ; preds = %.preheader89.loopexit.unr-lcssa
  %68 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %indvars.iv141.unr
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp slt i32 %69, 2
  br i1 %70, label %71, label %.preheader89

71:                                               ; preds = %.lr.ph104.epil
  %72 = add nsw i32 %.unr, 1
  store i32 %72, ptr @r, align 4, !tbaa !5
  %73 = sext i32 %.unr to i64
  %74 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %73
  %75 = trunc nuw nsw i64 %indvars.iv141.unr to i32
  store i32 %75, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %indvars.iv141.unr
  store i8 1, ptr %76, align 1, !tbaa !17
  br label %.preheader89

.preheader89:                                     ; preds = %.preheader89.loopexit.unr-lcssa, %71, %.lr.ph104.epil, %.preheader90
  %77 = phi i32 [ %r.promoted, %.preheader90 ], [ %.lcssa170.ph, %.preheader89.loopexit.unr-lcssa ], [ %.unr, %.lr.ph104.epil ], [ %72, %71 ]
  %78 = load i32, ptr @l, align 4, !tbaa !5
  %79 = icmp slt i32 %78, %77
  br i1 %79, label %.lr.ph108, label %._crit_edge109

.lr.ph104:                                        ; preds = %100, %.lr.ph104.preheader.new
  %indvars.iv141 = phi i64 [ 1, %.lr.ph104.preheader.new ], [ %indvars.iv.next142.1, %100 ]
  %80 = phi i32 [ %r.promoted, %.lr.ph104.preheader.new ], [ %101, %100 ]
  %niter = phi i64 [ 0, %.lr.ph104.preheader.new ], [ %niter.next.1, %100 ]
  %81 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %indvars.iv141
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp slt i32 %82, 2
  br i1 %83, label %84, label %.lr.ph104.1

84:                                               ; preds = %.lr.ph104
  %85 = add nsw i32 %80, 1
  store i32 %85, ptr @r, align 4, !tbaa !5
  %86 = sext i32 %80 to i64
  %87 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %86
  %88 = trunc nuw nsw i64 %indvars.iv141 to i32
  store i32 %88, ptr %87, align 4, !tbaa !5
  %89 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %indvars.iv141
  store i8 1, ptr %89, align 1, !tbaa !17
  br label %.lr.ph104.1

.lr.ph104.1:                                      ; preds = %.lr.ph104, %84
  %90 = phi i32 [ %80, %.lr.ph104 ], [ %85, %84 ]
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %91 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %indvars.iv.next142
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp slt i32 %92, 2
  br i1 %93, label %94, label %100

94:                                               ; preds = %.lr.ph104.1
  %95 = add nsw i32 %90, 1
  store i32 %95, ptr @r, align 4, !tbaa !5
  %96 = sext i32 %90 to i64
  %97 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %96
  %98 = trunc nuw nsw i64 %indvars.iv.next142 to i32
  store i32 %98, ptr %97, align 4, !tbaa !5
  %99 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %indvars.iv.next142
  store i8 1, ptr %99, align 1, !tbaa !17
  br label %100

100:                                              ; preds = %94, %.lr.ph104.1
  %101 = phi i32 [ %90, %.lr.ph104.1 ], [ %95, %94 ]
  %indvars.iv.next142.1 = add nuw nsw i64 %indvars.iv141, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader89.loopexit.unr-lcssa, label %.lr.ph104, !llvm.loop !19

.lr.ph108:                                        ; preds = %.preheader89, %._crit_edge107
  %102 = phi i32 [ %112, %._crit_edge107 ], [ %78, %.preheader89 ]
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr @l, align 4, !tbaa !5
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [101 x %"class.std::vector"], ptr @e, i64 0, i64 %107
  %109 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #7
  store ptr %109, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %110 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #7
  store ptr %110, ptr %2, align 8
  %111 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br i1 %111, label %.lr.ph106, label %._crit_edge107

._crit_edge107:                                   ; preds = %138, %.lr.ph108
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %112 = load i32, ptr @l, align 4, !tbaa !5
  %113 = load i32, ptr @r, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %.lr.ph108, label %._crit_edge109.loopexit, !llvm.loop !20

.lr.ph106:                                        ; preds = %.lr.ph108, %138
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !17, !range !21, !noundef !22
  %120 = trunc nuw i8 %119 to i1
  br i1 %120, label %138, label %121

121:                                              ; preds = %.lr.ph106
  %122 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %117
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr %122, align 4, !tbaa !5
  %125 = load i32, ptr %115, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [101 x i32], ptr @deg, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = icmp slt i32 %128, 2
  br i1 %129, label %130, label %138

130:                                              ; preds = %121
  %131 = load i32, ptr @r, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr @r, align 4, !tbaa !5
  %133 = sext i32 %131 to i64
  %134 = getelementptr inbounds [101 x i32], ptr @que, i64 0, i64 %133
  store i32 %125, ptr %134, align 4, !tbaa !5
  %135 = load i32, ptr %115, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %136
  store i8 1, ptr %137, align 1, !tbaa !17
  br label %138

138:                                              ; preds = %121, %130, %.lr.ph106
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %140 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #7
  store ptr %140, ptr %2, align 8
  %141 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br i1 %141, label %.lr.ph106, label %._crit_edge107, !llvm.loop !23

._crit_edge109.loopexit:                          ; preds = %._crit_edge107
  %.pre161 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge109

._crit_edge109:                                   ; preds = %._crit_edge109.loopexit, %.preheader89
  %142 = phi i32 [ %.pre161, %._crit_edge109.loopexit ], [ %44, %.preheader89 ]
  store i32 1, ptr @ans, align 16, !tbaa !5
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %.lr.ph112, label %.preheader88

.preheader88:                                     ; preds = %167, %._crit_edge109
  %144 = load i32, ptr @n, align 4, !tbaa !5
  %.not85120 = icmp slt i32 %144, 1
  br i1 %.not85120, label %.preheader, label %.lr.ph122

.lr.ph112:                                        ; preds = %._crit_edge109, %167
  %145 = phi i32 [ %168, %167 ], [ %142, %._crit_edge109 ]
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %167 ], [ 0, %._crit_edge109 ]
  %146 = getelementptr inbounds [10001 x i32], ptr @u, i64 0, i64 %indvars.iv146
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !17, !range !21, !noundef !22
  %151 = getelementptr inbounds [10001 x i32], ptr @v, i64 0, i64 %indvars.iv146
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !17, !range !21, !noundef !22
  %.not87 = icmp eq i8 %150, %155
  br i1 %.not87, label %167, label %156

156:                                              ; preds = %.lr.ph112
  %157 = trunc nuw i8 %155 to i1
  br i1 %157, label %158, label %159

158:                                              ; preds = %156
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %146, ptr noundef nonnull align 4 dereferenceable(4) %151) #7
  %.pre162 = load i32, ptr %146, align 4, !tbaa !5
  %.pre163 = load i32, ptr %151, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %158, %156
  %160 = phi i32 [ %.pre163, %158 ], [ %152, %156 ]
  %161 = phi i32 [ %.pre162, %158 ], [ %147, %156 ]
  call void @_Z3pfsiib(i32 noundef %161, i32 noundef %160, i1 noundef zeroext false)
  %162 = load i32, ptr %146, align 4, !tbaa !5
  %163 = load i32, ptr %151, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %162, i32 noundef %163)
  %164 = load i32, ptr %146, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %165
  call void @_Z5mergePiS_(ptr noundef nonnull @ans, ptr noundef nonnull %166)
  %.pre164 = load i32, ptr @m, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %.lr.ph112, %159
  %168 = phi i32 [ %145, %.lr.ph112 ], [ %.pre164, %159 ]
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %169 = sext i32 %168 to i64
  %170 = icmp slt i64 %indvars.iv.next147, %169
  br i1 %170, label %.lr.ph112, label %.preheader88, !llvm.loop !24

.preheader:                                       ; preds = %229, %.preheader88
  %171 = phi i32 [ %144, %.preheader88 ], [ %230, %229 ]
  %.not86123 = icmp slt i32 %171, 0
  br i1 %.not86123, label %._crit_edge126, label %.lr.ph125

.lr.ph122:                                        ; preds = %.preheader88, %229
  %172 = phi i32 [ %230, %229 ], [ %144, %.preheader88 ]
  %indvars.iv154 = phi i64 [ %indvars.iv.next155, %229 ], [ 1, %.preheader88 ]
  %173 = getelementptr inbounds [101 x i8], ptr @val, i64 0, i64 %indvars.iv154
  %174 = load i8, ptr %173, align 1, !tbaa !17, !range !21, !noundef !22
  %175 = trunc nuw i8 %174 to i1
  br i1 %175, label %176, label %229

176:                                              ; preds = %.lr.ph122
  %177 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %indvars.iv154
  %178 = load i8, ptr %177, align 1, !tbaa !17, !range !21, !noundef !22
  %179 = trunc nuw i8 %178 to i1
  br i1 %179, label %229, label %180

180:                                              ; preds = %176
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) @tmp, i8 0, i64 404, i1 false)
  %181 = trunc nuw nsw i64 %indvars.iv154 to i32
  call void @_Z3pfsiib(i32 noundef %181, i32 noundef -1, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %182 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  store ptr %182, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %183 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  store ptr %183, ptr %4, align 8
  %184 = 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) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %184, label %.lr.ph114, label %._crit_edge115

._crit_edge115:                                   ; preds = %.lr.ph114, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %185 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  %186 = trunc i64 %185 to i32
  %187 = icmp sgt i32 %186, 1
  br i1 %187, label %.lr.ph118.preheader, label %._crit_edge119

.lr.ph118.preheader:                              ; preds = %._crit_edge115
  %188 = add i64 %185, 4294967295
  %189 = and i64 %185, 2147483647
  %wide.trip.count152 = and i64 %188, 4294967295
  %xtraiter173 = and i64 %188, 1
  %190 = icmp eq i64 %wide.trip.count152, 1
  br i1 %190, label %._crit_edge119.loopexit.unr-lcssa, label %.lr.ph118.preheader.new

.lr.ph118.preheader.new:                          ; preds = %.lr.ph118.preheader
  %unroll_iter175 = sub nsw i64 %wide.trip.count152, %xtraiter173
  br label %.lr.ph118

.lr.ph114:                                        ; preds = %180, %.lr.ph114
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %192 = load i32, ptr %191, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %192, i32 noundef -1)
  %193 = load i32, ptr %191, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [101 x [101 x i32]], ptr @f, i64 0, i64 %194
  call void @_Z4combPiS_(ptr noundef nonnull @tmp, ptr noundef nonnull %195)
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %197 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @seq) #7
  store ptr %197, ptr %4, align 8
  %198 = 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) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %198, label %.lr.ph114, label %._crit_edge115, !llvm.loop !25

._crit_edge119.loopexit.unr-lcssa:                ; preds = %.lr.ph118, %.lr.ph118.preheader
  %indvars.iv149.unr = phi i64 [ 0, %.lr.ph118.preheader ], [ %indvars.iv.next150.1, %.lr.ph118 ]
  %lcmp.mod174.not = icmp eq i64 %xtraiter173, 0
  br i1 %lcmp.mod174.not, label %._crit_edge119, label %.lr.ph118.epil

.lr.ph118.epil:                                   ; preds = %._crit_edge119.loopexit.unr-lcssa
  %199 = getelementptr inbounds [101 x i32], ptr @tmp, i64 0, i64 %indvars.iv149.unr
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = sub nsw i64 %189, %indvars.iv149.unr
  %203 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = mul nsw i64 %205, %201
  %207 = srem i64 %206, 1000000009
  %208 = trunc nsw i64 %207 to i32
  store i32 %208, ptr %199, align 4, !tbaa !5
  br label %._crit_edge119

._crit_edge119:                                   ; preds = %.lr.ph118.epil, %._crit_edge119.loopexit.unr-lcssa, %._crit_edge115
  call void @_Z5mergePiS_(ptr noundef nonnull @ans, ptr noundef nonnull @tmp)
  %.pre165 = load i32, ptr @n, align 4, !tbaa !5
  br label %229

.lr.ph118:                                        ; preds = %.lr.ph118, %.lr.ph118.preheader.new
  %indvars.iv149 = phi i64 [ 0, %.lr.ph118.preheader.new ], [ %indvars.iv.next150.1, %.lr.ph118 ]
  %niter176 = phi i64 [ 0, %.lr.ph118.preheader.new ], [ %niter176.next.1, %.lr.ph118 ]
  %209 = getelementptr inbounds [101 x i32], ptr @tmp, i64 0, i64 %indvars.iv149
  %210 = load i32, ptr %209, align 8, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = sub nsw i64 %189, %indvars.iv149
  %213 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = mul nsw i64 %215, %211
  %217 = srem i64 %216, 1000000009
  %218 = trunc nsw i64 %217 to i32
  store i32 %218, ptr %209, align 8, !tbaa !5
  %indvars.iv.next150 = or disjoint i64 %indvars.iv149, 1
  %219 = getelementptr inbounds [101 x i32], ptr @tmp, i64 0, i64 %indvars.iv.next150
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = sub nsw i64 %189, %indvars.iv.next150
  %223 = getelementptr inbounds [101 x i32], ptr @inv, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = mul nsw i64 %225, %221
  %227 = srem i64 %226, 1000000009
  %228 = trunc nsw i64 %227 to i32
  store i32 %228, ptr %219, align 4, !tbaa !5
  %indvars.iv.next150.1 = add nuw nsw i64 %indvars.iv149, 2
  %niter176.next.1 = add i64 %niter176, 2
  %niter176.ncmp.1 = icmp eq i64 %niter176.next.1, %unroll_iter175
  br i1 %niter176.ncmp.1, label %._crit_edge119.loopexit.unr-lcssa, label %.lr.ph118, !llvm.loop !26

229:                                              ; preds = %.lr.ph122, %176, %._crit_edge119
  %230 = phi i32 [ %172, %.lr.ph122 ], [ %172, %176 ], [ %.pre165, %._crit_edge119 ]
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %231 = sext i32 %230 to i64
  %.not85.not = icmp slt i64 %indvars.iv154, %231
  br i1 %.not85.not, label %.lr.ph122, label %.preheader, !llvm.loop !27

._crit_edge126:                                   ; preds = %.lr.ph125, %.preheader
  ret i32 0

.lr.ph125:                                        ; preds = %.preheader, %.lr.ph125
  %indvars.iv157 = phi i64 [ %indvars.iv.next158, %.lr.ph125 ], [ 0, %.preheader ]
  %232 = getelementptr inbounds [101 x i32], ptr @ans, i64 0, i64 %indvars.iv157
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %233)
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %235 = load i32, ptr @n, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %.not86.not = icmp slt i64 %indvars.iv157, %236
  br i1 %.not86.not, label %.lr.ph125, label %._crit_edge126, !llvm.loop !28
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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 = { 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 #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: write) }
attributes #5 = { mustprogress norecurse 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 #6 = { nofree nounwind "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 #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}


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