; LLVM IR from tangjz/acm-icpc :: hdu (6453)

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

@inv = external dso_local global [1201 x i32], align 16
@iact = external dso_local global [1201 x i32], align 16
@pw = external dso_local global [1201 x [1201 x i32]], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@a = external dso_local global [10001 x i32], align 16
@cnt = external dso_local global [1201 x i32], align 16
@poly = external dso_local global [1201 x i32], align 16
@e = external dso_local global [10001 x %"class.std::vector"], align 16
@vis = external dso_local global [10001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) #1

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

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

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

19:                                               ; preds = %43, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp slt i32 %20, 1201
  br i1 %21, label %23, label %22

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

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

43:                                               ; preds = %23
  %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 %19, !llvm.loop !9

46:                                               ; preds = %22
  store i32 1, ptr @iact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %98, %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %48, 1201
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %47
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1201 x i32], ptr @inv, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = mul nsw i64 %57, %62
  %64 = srem i64 %63, 1000000007
  %65 = trunc i64 %64 to i32
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %67
  store i32 %65, ptr %68, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %94, %51
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = icmp slt i32 %70, 1201
  br i1 %71, label %73, label %72

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

73:                                               ; preds = %69
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1201 x [1201 x i32]], ptr @pw, i64 0, i64 %76
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1201 x i32], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = mul nsw i64 %82, %84
  %86 = srem i64 %85, 1000000007
  %87 = trunc i64 %86 to i32
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1201 x [1201 x i32]], ptr @pw, i64 0, i64 %89
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1201 x i32], ptr %90, i64 0, i64 %92
  store i32 %87, ptr %93, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %73
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %5, align 4, !tbaa !5
  br label %69, !llvm.loop !11

97:                                               ; preds = %72
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %3, align 4, !tbaa !5
  br label %47, !llvm.loop !12

101:                                              ; preds = %50
  %102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %353, %101
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = load i32, ptr @t, align 4, !tbaa !5
  %106 = icmp sle i32 %104, %105
  br i1 %106, label %108, label %107

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

108:                                              ; preds = %103
  %109 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n, ptr noundef @m, ptr noundef @w)
  %110 = load i32, ptr @w, align 4, !tbaa !5
  %111 = mul nsw i32 %110, 3
  store i32 %111, ptr @w, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %125, %108
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %117, label %116

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

117:                                              ; preds = %112
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr @a, i64 %119
  %121 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %120)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e, i64 0, i64 %123
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %124) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  br label %125

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

128:                                              ; preds = %116
  br label %129

129:                                              ; preds = %133, %128
  %130 = load i32, ptr @m, align 4, !tbaa !5
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr @m, align 4, !tbaa !5
  %132 = icmp ne i32 %130, 0
  br i1 %132, label %133, label %138

133:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %134 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %9, ptr noundef %10)
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e, i64 0, i64 %136
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %137, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %129, !llvm.loop !14

138:                                              ; preds = %129
  %139 = load i32, ptr @n, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = mul i64 %140, 1
  call void @llvm.memset.p0.i64(ptr align 1 getelementptr inbounds (i8, ptr @vis, i64 1), i8 0, i64 %141, i1 false)
  %142 = load i32, ptr @w, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = mul i64 %143, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @cnt, i64 1), i8 0, i64 %144, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %159, %138
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = load i32, ptr @n, align 4, !tbaa !5
  %148 = icmp sle i32 %146, %147
  br i1 %148, label %150, label %149

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

150:                                              ; preds = %145
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !15, !range !17, !noundef !18
  %155 = trunc i8 %154 to i1
  br i1 %155, label %158, label %156

156:                                              ; preds = %150
  %157 = load i32, ptr %11, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %157)
  br label %158

158:                                              ; preds = %156, %150
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %11, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !5
  br label %145, !llvm.loop !19

162:                                              ; preds = %149
  %163 = load i32, ptr @w, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = mul i64 %165, 4
  call void @llvm.memset.p0.i64(ptr align 16 @poly, i8 0, i64 %166, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %265, %162
  %168 = load i32, ptr %12, align 4, !tbaa !5
  %169 = load i32, ptr @w, align 4, !tbaa !5
  %170 = icmp sle i32 %168, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %167
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %268

172:                                              ; preds = %167
  %173 = load i32, ptr %12, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [1201 x i32], ptr @cnt, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %179, label %178

178:                                              ; preds = %172
  br label %265

179:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %180 = load i32, ptr %12, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [1201 x i32], ptr @cnt, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = icmp slt i32 %183, 0
  br i1 %184, label %185, label %191

185:                                              ; preds = %179
  %186 = load i32, ptr %12, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1201 x i32], ptr @cnt, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1000000007
  br label %196

191:                                              ; preds = %179
  %192 = load i32, ptr %12, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [1201 x i32], ptr @cnt, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %191, %185
  %197 = phi i32 [ %190, %185 ], [ %195, %191 ]
  store i32 %197, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [1201 x i32], ptr @inv, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  store i32 %201, ptr %14, align 4, !tbaa !5
  %202 = load i32, ptr %13, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = mul nsw i64 %203, 166666668
  %205 = srem i64 %204, 1000000007
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = mul nsw i64 %205, %210
  %212 = srem i64 %211, 1000000007
  %213 = load i32, ptr @w, align 4, !tbaa !5
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = sub nsw i32 %213, %214
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = mul nsw i64 %212, %219
  %221 = srem i64 %220, 1000000007
  %222 = trunc i64 %221 to i32
  store i32 %222, ptr %13, align 4, !tbaa !5
  %223 = load i32, ptr @w, align 4, !tbaa !5
  %224 = load i32, ptr %12, align 4, !tbaa !5
  %225 = sub nsw i32 %223, %224
  %226 = and i32 %225, 1
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %231, label %228

228:                                              ; preds = %196
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = sub nsw i32 1000000007, %229
  store i32 %230, ptr %13, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %228, %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %261, %231
  %233 = load i32, ptr %15, align 4, !tbaa !5
  %234 = load i32, ptr @w, align 4, !tbaa !5
  %235 = icmp sle i32 %233, %234
  br i1 %235, label %237, label %236

236:                                              ; preds = %232
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %264

237:                                              ; preds = %232
  %238 = load i32, ptr %13, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = load i32, ptr %14, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = mul nsw i64 %239, %241
  %243 = srem i64 %242, 1000000007
  %244 = trunc i64 %243 to i32
  store i32 %244, ptr %13, align 4, !tbaa !5
  %245 = load i32, ptr %13, align 4, !tbaa !5
  %246 = load i32, ptr %15, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = add nsw i32 %249, %245
  store i32 %250, ptr %248, align 4, !tbaa !5
  %251 = icmp sge i32 %250, 1000000007
  br i1 %251, label %252, label %259

252:                                              ; preds = %237
  %253 = load i32, ptr %15, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = sub nsw i32 %256, 1000000007
  store i32 %257, ptr %255, align 4, !tbaa !5
  %258 = icmp ne i32 %257, 0
  br label %259

259:                                              ; preds = %252, %237
  %260 = phi i1 [ false, %237 ], [ %258, %252 ]
  br label %261

261:                                              ; preds = %259
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %15, align 4, !tbaa !5
  br label %232, !llvm.loop !20

264:                                              ; preds = %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %265

265:                                              ; preds = %264, %178
  %266 = load i32, ptr %12, align 4, !tbaa !5
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %12, align 4, !tbaa !5
  br label %167, !llvm.loop !21

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

269:                                              ; preds = %311, %268
  %270 = load i32, ptr %16, align 4, !tbaa !5
  %271 = load i32, ptr @w, align 4, !tbaa !5
  %272 = icmp sle i32 %270, %271
  br i1 %272, label %274, label %273

273:                                              ; preds = %269
  store i32 28, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %314

274:                                              ; preds = %269
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %275 = load i32, ptr @w, align 4, !tbaa !5
  store i32 %275, ptr %17, align 4, !tbaa !5
  br label %276

276:                                              ; preds = %307, %274
  %277 = load i32, ptr %17, align 4, !tbaa !5
  %278 = icmp sge i32 %277, 0
  br i1 %278, label %280, label %279

279:                                              ; preds = %276
  store i32 31, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %310

280:                                              ; preds = %276
  %281 = load i32, ptr %17, align 4, !tbaa !5
  %282 = icmp ne i32 %281, 0
  br i1 %282, label %283, label %289

283:                                              ; preds = %280
  %284 = load i32, ptr %17, align 4, !tbaa !5
  %285 = sub nsw i32 %284, 1
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  br label %290

289:                                              ; preds = %280
  br label %290

290:                                              ; preds = %289, %283
  %291 = phi i32 [ %288, %283 ], [ 0, %289 ]
  %292 = sext i32 %291 to i64
  %293 = load i32, ptr %16, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = load i32, ptr %17, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = mul nsw i64 %294, %299
  %301 = sub nsw i64 %292, %300
  %302 = srem i64 %301, 1000000007
  %303 = trunc i64 %302 to i32
  %304 = load i32, ptr %17, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %305
  store i32 %303, ptr %306, align 4, !tbaa !5
  br label %307

307:                                              ; preds = %290
  %308 = load i32, ptr %17, align 4, !tbaa !5
  %309 = add nsw i32 %308, -1
  store i32 %309, ptr %17, align 4, !tbaa !5
  br label %276, !llvm.loop !22

310:                                              ; preds = %279
  br label %311

311:                                              ; preds = %310
  %312 = load i32, ptr %16, align 4, !tbaa !5
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %16, align 4, !tbaa !5
  br label %269, !llvm.loop !23

314:                                              ; preds = %273
  %315 = load i32, ptr %6, align 4, !tbaa !5
  %316 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %315)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %317

317:                                              ; preds = %349, %314
  %318 = load i32, ptr %18, align 4, !tbaa !5
  %319 = load i32, ptr @w, align 4, !tbaa !5
  %320 = icmp sle i32 %318, %319
  br i1 %320, label %322, label %321

321:                                              ; preds = %317
  store i32 34, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %352

322:                                              ; preds = %317
  %323 = load i32, ptr %18, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = icmp slt i32 %326, 0
  br i1 %327, label %328, label %334

328:                                              ; preds = %322
  %329 = load i32, ptr %18, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %330
  %332 = load i32, ptr %331, align 4, !tbaa !5
  %333 = add nsw i32 %332, 1000000007
  br label %339

334:                                              ; preds = %322
  %335 = load i32, ptr %18, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %336
  %338 = load i32, ptr %337, align 4, !tbaa !5
  br label %339

339:                                              ; preds = %334, %328
  %340 = phi i32 [ %333, %328 ], [ %338, %334 ]
  %341 = load i32, ptr %18, align 4, !tbaa !5
  %342 = load i32, ptr @w, align 4, !tbaa !5
  %343 = icmp eq i32 %341, %342
  %344 = zext i1 %343 to i64
  %345 = getelementptr inbounds [3 x i8], ptr @.str.6, i64 0, i64 %344
  %346 = load i8, ptr %345, align 1, !tbaa !24
  %347 = sext i8 %346 to i32
  %348 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %340, i32 noundef %347)
  br label %349

349:                                              ; preds = %339
  %350 = load i32, ptr %18, align 4, !tbaa !5
  %351 = add nsw i32 %350, 1
  store i32 %351, ptr %18, align 4, !tbaa !5
  br label %317, !llvm.loop !25

352:                                              ; preds = %321
  br label %353

353:                                              ; preds = %352
  %354 = load i32, ptr %6, align 4, !tbaa !5
  %355 = add nsw i32 %354, 1
  store i32 %355, ptr %6, align 4, !tbaa !5
  br label %103, !llvm.loop !26

356:                                              ; preds = %107
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 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)) #1 align 2

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

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

@inv = external dso_local local_unnamed_addr global [1201 x i32], align 16
@iact = external dso_local local_unnamed_addr global [1201 x i32], align 16
@pw = external dso_local local_unnamed_addr global [1201 x [1201 x i32]], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@a = external dso_local global [10001 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [1201 x i32], align 16
@poly = external dso_local local_unnamed_addr global [1201 x i32], align 16
@e = external dso_local global [10001 x %"class.std::vector"], align 16
@vis = external dso_local local_unnamed_addr global [10001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @pw, i64 4), align 4, !tbaa !5
  store i32 1, ptr @pw, align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  br label %5

4:                                                ; preds = %5
  store i32 1, ptr @iact, align 16, !tbaa !5
  br label %23

5:                                                ; preds = %0, %5
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %5 ]
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = udiv i32 1000000007, %6
  %8 = zext nneg i32 %7 to i64
  %9 = urem i32 1000000007, %6
  %10 = zext nneg i32 %9 to i64
  %11 = getelementptr inbounds [1201 x i32], ptr @inv, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = mul nsw i64 %13, %8
  %15 = srem i64 %14, 1000000007
  %16 = trunc nsw i64 %15 to i32
  %17 = sub nsw i32 1000000007, %16
  %18 = getelementptr inbounds [1201 x i32], ptr @inv, i64 0, i64 %indvars.iv
  store i32 %17, ptr %18, align 4, !tbaa !5
  %19 = getelementptr inbounds [1201 x i32], ptr @pw, i64 0, i64 %indvars.iv
  store i32 1, ptr %19, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1201
  br i1 %exitcond.not, label %4, label %5, !llvm.loop !9

20:                                               ; preds = %33
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %22 = load i32, ptr @t, align 4, !tbaa !5
  %.not123 = icmp slt i32 %22, 1
  br i1 %.not123, label %._crit_edge127, label %.lr.ph126

23:                                               ; preds = %4, %33
  %24 = phi i64 [ 1, %4 ], [ %30, %33 ]
  %indvars.iv133 = phi i64 [ 1, %4 ], [ %indvars.iv.next134, %33 ]
  %25 = add nsw i64 %indvars.iv133, -1
  %26 = getelementptr inbounds [1201 x i32], ptr @inv, i64 0, i64 %indvars.iv133
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %24, %28
  %30 = srem i64 %29, 1000000007
  %31 = trunc nsw i64 %30 to i32
  %32 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %indvars.iv133
  store i32 %31, ptr %32, align 4, !tbaa !5
  br label %34

33:                                               ; preds = %34
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond136.not = icmp eq i64 %indvars.iv.next134, 1201
  br i1 %exitcond136.not, label %20, label %23, !llvm.loop !11

34:                                               ; preds = %34, %23
  %indvars.iv129 = phi i64 [ 1, %23 ], [ %indvars.iv.next130.1, %34 ]
  %35 = getelementptr inbounds [1201 x [1201 x i32]], ptr @pw, i64 0, i64 %25, i64 %indvars.iv129
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = mul nsw i64 %indvars.iv129, %37
  %39 = srem i64 %38, 1000000007
  %40 = trunc nsw i64 %39 to i32
  %41 = getelementptr inbounds [1201 x [1201 x i32]], ptr @pw, i64 0, i64 %indvars.iv133, i64 %indvars.iv129
  store i32 %40, ptr %41, align 4, !tbaa !5
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %42 = getelementptr inbounds [1201 x [1201 x i32]], ptr @pw, i64 0, i64 %25, i64 %indvars.iv.next130
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = mul nsw i64 %indvars.iv.next130, %44
  %46 = srem i64 %45, 1000000007
  %47 = trunc nsw i64 %46 to i32
  %48 = getelementptr inbounds [1201 x [1201 x i32]], ptr @pw, i64 0, i64 %indvars.iv133, i64 %indvars.iv.next130
  store i32 %47, ptr %48, align 4, !tbaa !5
  %indvars.iv.next130.1 = add nuw nsw i64 %indvars.iv129, 2
  %exitcond132.not.1 = icmp eq i64 %indvars.iv.next130.1, 1201
  br i1 %exitcond132.not.1, label %33, label %34, !llvm.loop !12

._crit_edge127:                                   ; preds = %._crit_edge122, %20
  ret i32 0

.lr.ph126:                                        ; preds = %20, %._crit_edge122
  %.071124 = phi i32 [ %153, %._crit_edge122 ], [ 1, %20 ]
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @w)
  %50 = load i32, ptr @w, align 4, !tbaa !5
  %51 = mul nsw i32 %50, 3
  store i32 %51, ptr @w, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %.not7994 = icmp slt i32 %52, 1
  br i1 %.not7994, label %.preheader90, label %.lr.ph

.preheader90:                                     ; preds = %.lr.ph, %.lr.ph126
  %53 = phi i32 [ %52, %.lr.ph126 ], [ %59, %.lr.ph ]
  %54 = load i32, ptr @m, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr @m, align 4, !tbaa !5
  %.not8096 = icmp eq i32 %54, 0
  br i1 %.not8096, label %._crit_edge, label %.lr.ph97

.lr.ph:                                           ; preds = %.lr.ph126, %.lr.ph
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %.lr.ph ], [ 1, %.lr.ph126 ]
  %56 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv137
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %56)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %58 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv137
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %58) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %.not79.not = icmp slt i64 %indvars.iv137, %60
  br i1 %.not79.not, label %.lr.ph, label %.preheader90, !llvm.loop !13

.lr.ph97:                                         ; preds = %.preheader90, %.lr.ph97
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10001 x %"class.std::vector"], ptr @e, i64 0, i64 %63
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr @m, align 4, !tbaa !5
  %.not80 = icmp eq i32 %65, 0
  br i1 %.not80, label %._crit_edge.loopexit, label %.lr.ph97, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %.lr.ph97
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader90
  %67 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %53, %.preheader90 ]
  %68 = sext i32 %67 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @vis, i64 1), i8 0, i64 %68, i1 false)
  %69 = load i32, ptr @w, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = shl nsw i64 %70, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @cnt, i64 4), i8 0, i64 %71, i1 false)
  %.not8198 = icmp slt i32 %67, 1
  br i1 %.not8198, label %._crit_edge102, label %.lr.ph101

._crit_edge102.loopexit:                          ; preds = %83
  %.pre164 = load i32, ptr @w, align 4, !tbaa !5
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge102.loopexit, %._crit_edge
  %72 = phi i32 [ %.pre164, %._crit_edge102.loopexit ], [ %69, %._crit_edge ]
  %73 = add i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = shl nsw i64 %74, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @poly, i8 0, i64 %75, i1 false)
  %.not82108 = icmp slt i32 %72, 1
  br i1 %.not82108, label %.preheader89, label %.lr.ph111.preheader

.lr.ph111.preheader:                              ; preds = %._crit_edge102
  %76 = zext nneg i32 %72 to i64
  %wide.trip.count150 = zext i32 %73 to i64
  %xtraiter = and i64 %wide.trip.count150, 1
  %unroll_iter = and i64 %wide.trip.count150, 4294967294
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph111

.lr.ph101:                                        ; preds = %._crit_edge, %83
  %77 = phi i32 [ %84, %83 ], [ %67, %._crit_edge ]
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %83 ], [ 1, %._crit_edge ]
  %78 = getelementptr inbounds [10001 x i8], ptr @vis, i64 0, i64 %indvars.iv140
  %79 = load i8, ptr %78, align 1, !tbaa !15, !range !17, !noundef !18
  %80 = trunc nuw i8 %79 to i1
  br i1 %80, label %83, label %81

81:                                               ; preds = %.lr.ph101
  %82 = trunc nuw nsw i64 %indvars.iv140 to i32
  call void @_Z3dfsi(i32 noundef %82)
  %.pre163 = load i32, ptr @n, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %.lr.ph101, %81
  %84 = phi i32 [ %77, %.lr.ph101 ], [ %.pre163, %81 ]
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %85 = sext i32 %84 to i64
  %.not81.not = icmp slt i64 %indvars.iv140, %85
  br i1 %.not81.not, label %.lr.ph101, label %._crit_edge102.loopexit, !llvm.loop !19

.preheader89:                                     ; preds = %.loopexit, %._crit_edge102
  %.not83115 = icmp slt i32 %72, 0
  br i1 %.not83115, label %._crit_edge117.split.us, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader89
  %86 = zext nneg i32 %72 to i64
  %wide.trip.count158 = zext i32 %73 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge114.us
  %indvars.iv155 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next156, %._crit_edge114.us ]
  br label %87

87:                                               ; preds = %.preheader.us, %._crit_edge165
  %indvars.iv152 = phi i64 [ %86, %.preheader.us ], [ %indvars.iv.next153.pre-phi, %._crit_edge165 ]
  %.not85.us = icmp eq i64 %indvars.iv152, 0
  br i1 %.not85.us, label %._crit_edge165, label %88

88:                                               ; preds = %87
  %89 = add nsw i64 %indvars.iv152, -1
  %90 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  br label %._crit_edge165

._crit_edge165:                                   ; preds = %87, %88
  %indvars.iv.next153.pre-phi = phi i64 [ %89, %88 ], [ -1, %87 ]
  %92 = phi i32 [ %91, %88 ], [ 0, %87 ]
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %indvars.iv152
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = mul nsw i64 %indvars.iv155, %96
  %98 = sub nsw i64 %93, %97
  %99 = srem i64 %98, 1000000007
  %100 = trunc nsw i64 %99 to i32
  store i32 %100, ptr %94, align 4, !tbaa !5
  %101 = icmp sgt i64 %indvars.iv152, 0
  br i1 %101, label %87, label %._crit_edge114.us, !llvm.loop !20

._crit_edge114.us:                                ; preds = %._crit_edge165
  %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
  %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158
  br i1 %exitcond159.not, label %._crit_edge117.split.us, label %.preheader.us, !llvm.loop !21

.lr.ph111:                                        ; preds = %.lr.ph111.preheader, %.loopexit
  %indvars.iv147 = phi i64 [ 1, %.lr.ph111.preheader ], [ %indvars.iv.next148, %.loopexit ]
  %102 = getelementptr inbounds [1201 x i32], ptr @cnt, i64 0, i64 %indvars.iv147
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %.not86 = icmp eq i32 %103, 0
  br i1 %.not86, label %.loopexit, label %.lr.ph107

.lr.ph107:                                        ; preds = %.lr.ph111
  %104 = getelementptr inbounds [1201 x i32], ptr @inv, i64 0, i64 %indvars.iv147
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = sub nsw i64 %76, %indvars.iv147
  %108 = and i64 %107, 1
  %.not87 = icmp eq i64 %108, 0
  %109 = icmp slt i32 %103, 0
  %110 = add nsw i32 %103, 1000000007
  %111 = select i1 %109, i32 %110, i32 %103
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %112, 166666668
  %114 = srem i64 %113, 1000000007
  %115 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %indvars.iv147
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %114, %117
  %119 = srem i64 %118, 1000000007
  %120 = getelementptr inbounds [1201 x i32], ptr @iact, i64 0, i64 %107
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = mul nsw i64 %119, %122
  %124 = srem i64 %123, 1000000007
  %125 = sub nsw i64 1000000007, %124
  %.067 = select i1 %.not87, i64 %125, i64 %124
  br label %126

126:                                              ; preds = %126, %.lr.ph107
  %indvars.iv143 = phi i64 [ 0, %.lr.ph107 ], [ %indvars.iv.next144.1, %126 ]
  %.1104 = phi i64 [ %.067, %.lr.ph107 ], [ %136, %126 ]
  %niter = phi i64 [ 0, %.lr.ph107 ], [ %niter.next.1, %126 ]
  %127 = mul nsw i64 %.1104, %106
  %128 = srem i64 %127, 1000000007
  %129 = trunc nsw i64 %128 to i32
  %130 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %indvars.iv143
  %131 = load i32, ptr %130, align 8, !tbaa !5
  %132 = add nsw i32 %131, %129
  %133 = icmp sgt i32 %132, 1000000006
  %134 = add nsw i32 %132, -1000000007
  %spec.select = select i1 %133, i32 %134, i32 %132
  store i32 %spec.select, ptr %130, align 8, !tbaa !5
  %indvars.iv.next144 = or disjoint i64 %indvars.iv143, 1
  %135 = mul nsw i64 %128, %106
  %136 = srem i64 %135, 1000000007
  %137 = trunc nsw i64 %136 to i32
  %138 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %indvars.iv.next144
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %139, %137
  %141 = icmp sgt i32 %140, 1000000006
  %142 = add nsw i32 %140, -1000000007
  %spec.select.1 = select i1 %141, i32 %142, i32 %140
  store i32 %spec.select.1, ptr %138, align 4, !tbaa !5
  %indvars.iv.next144.1 = add nuw nsw i64 %indvars.iv143, 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 %.loopexit.loopexit.unr-lcssa, label %126, !llvm.loop !22

.loopexit.loopexit.unr-lcssa:                     ; preds = %126
  br i1 %lcmp.mod.not, label %.loopexit, label %.loopexit.loopexit.epilog-lcssa

.loopexit.loopexit.epilog-lcssa:                  ; preds = %.loopexit.loopexit.unr-lcssa
  %143 = mul nsw i64 %136, %106
  %144 = srem i64 %143, 1000000007
  %145 = trunc nsw i64 %144 to i32
  %146 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %indvars.iv.next144.1
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = add nsw i32 %147, %145
  %149 = icmp sgt i32 %148, 1000000006
  %150 = add nsw i32 %148, -1000000007
  %spec.select.epil = select i1 %149, i32 %150, i32 %148
  store i32 %spec.select.epil, ptr %146, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit.epilog-lcssa, %.loopexit.loopexit.unr-lcssa, %.lr.ph111
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150
  br i1 %exitcond151.not, label %.preheader89, label %.lr.ph111, !llvm.loop !23

._crit_edge117.split.us:                          ; preds = %._crit_edge114.us, %.preheader89
  %151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.071124)
  %152 = load i32, ptr @w, align 4, !tbaa !5
  %.not84118 = icmp slt i32 %152, 1
  br i1 %.not84118, label %._crit_edge122, label %.lr.ph121

._crit_edge122:                                   ; preds = %.lr.ph121, %._crit_edge117.split.us
  %153 = add nuw nsw i32 %.071124, 1
  %154 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.071124, %154
  br i1 %.not.not, label %.lr.ph126, label %._crit_edge127, !llvm.loop !24

.lr.ph121:                                        ; preds = %._crit_edge117.split.us, %.lr.ph121
  %indvars.iv160 = phi i64 [ %indvars.iv.next161, %.lr.ph121 ], [ 1, %._crit_edge117.split.us ]
  %155 = phi i32 [ %168, %.lr.ph121 ], [ %152, %._crit_edge117.split.us ]
  %156 = getelementptr inbounds [1201 x i32], ptr @poly, i64 0, i64 %indvars.iv160
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = icmp slt i32 %157, 0
  %159 = add nsw i32 %157, 1000000007
  %160 = select i1 %158, i32 %159, i32 %157
  %161 = zext i32 %155 to i64
  %162 = icmp eq i64 %indvars.iv160, %161
  %163 = zext i1 %162 to i64
  %164 = getelementptr inbounds [3 x i8], ptr @.str.6, i64 0, i64 %163
  %165 = load i8, ptr %164, align 1, !tbaa !25
  %166 = sext i8 %165 to i32
  %167 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %160, i32 noundef %166)
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %168 = load i32, ptr @w, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %.not84.not = icmp slt i64 %indvars.iv160, %169
  br i1 %.not84.not, label %.lr.ph121, label %._crit_edge122, !llvm.loop !26
}

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

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

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

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

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


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