; LLVM IR from tangjz/acm-icpc :: uoj/200.ll (Z6solve8v)

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

%struct.Edge = type { i32, i32, i32 }
%class.anon.7 = type { i8 }
%class.anon.9 = type { ptr }
%class.anon.10 = type { i8 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@mod = external dso_local global i32, align 4
@ans = external dso_local global [100001 x i32], align 16
@e = external dso_local global [150001 x %struct.Edge], align 16
@que = external dso_local global [100001 x %struct.Edge], align 16
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._Z6solve8v = external hidden unnamed_addr constant [14 x i8], align 1
@_ZZ6solve8vE4ways = external hidden global [1001 x [1001 x i32]], align 16
@_ZZ6solve8vE4poly = external hidden global [1001 x [1001 x i32]], align 16
@_ZZ6solve8vE3ord = external hidden global [10001 x i32], align 16
@_ZZ6solve8vE3vec = external hidden global [10001 x [1001 x i32]], align 16
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7mod_invi(i32 noundef) #4

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #5

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6solve8v() #1 {
  %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 ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %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
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca %class.anon.7, align 1
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca %class.anon.9, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca %class.anon.10, align 1
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #8
  store i32 1000, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 10000, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 11, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 1000000001, ptr %4, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp eq i32 %48, 1000
  br i1 %49, label %50, label %53

50:                                               ; preds = %0
  %51 = load i32, ptr @q, align 4, !tbaa !5
  %52 = icmp eq i32 %51, 10000
  br label %53

53:                                               ; preds = %50, %0
  %54 = phi i1 [ false, %0 ], [ %52, %50 ]
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  br label %58

56:                                               ; preds = %53
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.1, i32 noundef 491, ptr noundef @__PRETTY_FUNCTION__._Z6solve8v) #9
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %55
  call void @_Z8NTT_initi(i32 noundef 11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %75, %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %78

64:                                               ; preds = %59
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.Edge, ptr %67, i32 0, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 1
  br i1 %70, label %71, label %72

71:                                               ; preds = %64
  br label %74

72:                                               ; preds = %64
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 494, ptr noundef @__PRETTY_FUNCTION__._Z6solve8v) #9
  unreachable

73:                                               ; No predecessors!
  br label %74

74:                                               ; preds = %73, %71
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %5, align 4, !tbaa !5
  br label %59, !llvm.loop !11

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

79:                                               ; preds = %107, %78
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = load i32, ptr @q, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %110

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %86
  store ptr %87, ptr %8, align 8, !tbaa !13
  %88 = load ptr, ptr %8, align 8, !tbaa !13
  %89 = getelementptr inbounds %struct.Edge, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %97

92:                                               ; preds = %84
  %93 = load ptr, ptr %8, align 8, !tbaa !13
  %94 = getelementptr inbounds %struct.Edge, ptr %93, i32 0, i32 2
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = icmp slt i32 %95, 1000000001
  br label %97

97:                                               ; preds = %92, %84
  %98 = phi i1 [ false, %84 ], [ %96, %92 ]
  br i1 %98, label %99, label %100

99:                                               ; preds = %97
  br label %102

100:                                              ; preds = %97
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 498, ptr noundef @__PRETTY_FUNCTION__._Z6solve8v) #9
  unreachable

101:                                              ; No predecessors!
  br label %102

102:                                              ; preds = %101, %99
  %103 = load ptr, ptr %8, align 8, !tbaa !13
  %104 = getelementptr inbounds %struct.Edge, ptr %103, i32 0, i32 2
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %107

107:                                              ; preds = %102
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %7, align 4, !tbaa !5
  br label %79, !llvm.loop !16

110:                                              ; preds = %83
  %111 = load ptr, ptr @stderr, align 8, !tbaa !13
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str.12, i32 noundef %112) #8
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ6solve8vE4ways, i8 0, i64 4008004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %137, %110
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr @m, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %140

119:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %121
  store ptr %122, ptr %10, align 8, !tbaa !13
  %123 = load ptr, ptr %10, align 8, !tbaa !13
  %124 = getelementptr inbounds %struct.Edge, ptr %123, i32 0, i32 0
  %125 = load i32, ptr %124, align 4, !tbaa !15
  %126 = sub nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %127
  %129 = load ptr, ptr %10, align 8, !tbaa !13
  %130 = getelementptr inbounds %struct.Edge, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !17
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1001 x i32], ptr %128, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %134, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %137

137:                                              ; preds = %119
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %9, align 4, !tbaa !5
  br label %114, !llvm.loop !18

140:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %321, %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  %144 = icmp slt i32 %143, 1000
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %324

146:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %13, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %209, %146
  %150 = load i32, ptr %13, align 4, !tbaa !5
  %151 = icmp slt i32 %150, 1000
  br i1 %151, label %153, label %152

152:                                              ; preds = %149
  store i32 14, ptr %12, align 4
  br label %212

153:                                              ; preds = %149
  %154 = load i32, ptr %13, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %155
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [1001 x i32], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %208

162:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %163 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %163, ptr %14, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %182, %162
  %165 = load i32, ptr %14, align 4, !tbaa !5
  %166 = icmp slt i32 %165, 1000
  br i1 %166, label %168, label %167

167:                                              ; preds = %164
  store i32 17, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %185

168:                                              ; preds = %164
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %171
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [1001 x i32], ptr %172, i64 0, i64 %174
  %176 = load i32, ptr %13, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %177
  %179 = load i32, ptr %14, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [1001 x i32], ptr %178, i64 0, i64 %180
  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) %175, ptr noundef nonnull align 4 dereferenceable(4) %181) #8
  br label %182

182:                                              ; preds = %168
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %14, align 4, !tbaa !5
  br label %164, !llvm.loop !19

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

186:                                              ; preds = %204, %185
  %187 = load i32, ptr %15, align 4, !tbaa !5
  %188 = icmp slt i32 %187, 1000
  br i1 %188, label %190, label %189

189:                                              ; preds = %186
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %207

190:                                              ; preds = %186
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %192
  %194 = load i32, ptr %13, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [1001 x i32], ptr %193, i64 0, i64 %195
  %197 = load i32, ptr %15, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %198
  %200 = load i32, ptr %11, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [1001 x i32], ptr %199, i64 0, i64 %202
  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) %196, ptr noundef nonnull align 4 dereferenceable(4) %203) #8
  br label %204

204:                                              ; preds = %190
  %205 = load i32, ptr %15, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %15, align 4, !tbaa !5
  br label %186, !llvm.loop !20

207:                                              ; preds = %189
  store i32 14, ptr %12, align 4
  br label %212

208:                                              ; preds = %153
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %13, align 4, !tbaa !5
  br label %149, !llvm.loop !21

212:                                              ; preds = %207, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %11, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %216
  %218 = load i32, ptr %11, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [1001 x i32], ptr %217, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %224, label %223

223:                                              ; preds = %213
  br label %321

224:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %225 = load i32, ptr %11, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %227
  %229 = load i32, ptr %11, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [1001 x i32], ptr %228, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = call noundef i32 @_Z7mod_invi(i32 noundef %232)
  store i32 %233, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %234 = load i32, ptr %11, align 4, !tbaa !5
  %235 = add nsw i32 %234, 2
  store i32 %235, ptr %17, align 4, !tbaa !5
  br label %236

236:                                              ; preds = %317, %224
  %237 = load i32, ptr %17, align 4, !tbaa !5
  %238 = icmp slt i32 %237, 1000
  br i1 %238, label %240, label %239

239:                                              ; preds = %236
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %320

240:                                              ; preds = %236
  %241 = load i32, ptr %17, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %242
  %244 = load i32, ptr %11, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [1001 x i32], ptr %243, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = icmp ne i32 %247, 0
  br i1 %248, label %250, label %249

249:                                              ; preds = %240
  br label %317

250:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %251 = load i32, ptr %17, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %252
  %254 = load i32, ptr %11, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [1001 x i32], ptr %253, i64 0, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = load i32, ptr %16, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = mul nsw i64 %258, %260
  %262 = load i32, ptr @mod, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = srem i64 %261, %263
  %265 = trunc i64 %264 to i32
  store i32 %265, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %266 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %266, ptr %19, align 4, !tbaa !5
  br label %267

267:                                              ; preds = %289, %250
  %268 = load i32, ptr %19, align 4, !tbaa !5
  %269 = icmp slt i32 %268, 1000
  br i1 %269, label %271, label %270

270:                                              ; preds = %267
  store i32 26, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %292

271:                                              ; preds = %267
  %272 = load i32, ptr %17, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %273
  %275 = load i32, ptr %19, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [1001 x i32], ptr %274, i64 0, i64 %276
  %278 = load i32, ptr @mod, align 4, !tbaa !5
  %279 = load i32, ptr %18, align 4, !tbaa !5
  %280 = sub nsw i32 %278, %279
  %281 = load i32, ptr %11, align 4, !tbaa !5
  %282 = add nsw i32 %281, 1
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %283
  %285 = load i32, ptr %19, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [1001 x i32], ptr %284, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %277, i32 noundef %280, i32 noundef %288)
  br label %289

289:                                              ; preds = %271
  %290 = load i32, ptr %19, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %19, align 4, !tbaa !5
  br label %267, !llvm.loop !22

292:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %293

293:                                              ; preds = %313, %292
  %294 = load i32, ptr %20, align 4, !tbaa !5
  %295 = icmp slt i32 %294, 1000
  br i1 %295, label %297, label %296

296:                                              ; preds = %293
  store i32 29, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %316

297:                                              ; preds = %293
  %298 = load i32, ptr %20, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %299
  %301 = load i32, ptr %11, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [1001 x i32], ptr %300, i64 0, i64 %303
  %305 = load i32, ptr %18, align 4, !tbaa !5
  %306 = load i32, ptr %20, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %307
  %309 = load i32, ptr %17, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [1001 x i32], ptr %308, i64 0, i64 %310
  %312 = load i32, ptr %311, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %304, i32 noundef %305, i32 noundef %312)
  br label %313

313:                                              ; preds = %297
  %314 = load i32, ptr %20, align 4, !tbaa !5
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %20, align 4, !tbaa !5
  br label %293, !llvm.loop !23

316:                                              ; preds = %296
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %317

317:                                              ; preds = %316, %249
  %318 = load i32, ptr %17, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %17, align 4, !tbaa !5
  br label %236, !llvm.loop !24

320:                                              ; preds = %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %321

321:                                              ; preds = %320, %223
  %322 = load i32, ptr %11, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %11, align 4, !tbaa !5
  br label %141, !llvm.loop !25

324:                                              ; preds = %145
  store i32 1, ptr getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 1000), align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 999, ptr %21, align 4, !tbaa !5
  br label %325

325:                                              ; preds = %481, %324
  %326 = load i32, ptr %21, align 4, !tbaa !5
  %327 = icmp sge i32 %326, 0
  br i1 %327, label %329, label %328

328:                                              ; preds = %325
  store i32 32, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %484

329:                                              ; preds = %325
  %330 = load i32, ptr %21, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %331
  %333 = getelementptr inbounds [1001 x i32], ptr %332, i64 0, i64 0
  store i32 0, ptr %333, align 4, !tbaa !5
  %334 = load i32, ptr %21, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %335
  %337 = getelementptr inbounds [1001 x i32], ptr %336, i64 0, i64 0
  %338 = getelementptr inbounds i32, ptr %337, i64 1
  %339 = load i32, ptr %21, align 4, !tbaa !5
  %340 = add nsw i32 %339, 1
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %341
  %343 = getelementptr inbounds [1001 x i32], ptr %342, i64 0, i64 0
  %344 = load i32, ptr %21, align 4, !tbaa !5
  %345 = sub nsw i32 1000, %344
  %346 = sext i32 %345 to i64
  %347 = mul i64 %346, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %338, ptr align 4 %343, i64 %347, i1 false)
  %348 = load i32, ptr %21, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %349
  %351 = load i32, ptr %21, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [1001 x i32], ptr %350, i64 0, i64 %352
  %354 = load i32, ptr %353, align 4, !tbaa !5
  %355 = icmp ne i32 %354, 0
  br i1 %355, label %356, label %391

356:                                              ; preds = %329
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %357

357:                                              ; preds = %387, %356
  %358 = load i32, ptr %22, align 4, !tbaa !5
  %359 = load i32, ptr %21, align 4, !tbaa !5
  %360 = sub nsw i32 1000, %359
  %361 = icmp slt i32 %358, %360
  br i1 %361, label %363, label %362

362:                                              ; preds = %357
  store i32 35, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %390

363:                                              ; preds = %357
  %364 = load i32, ptr %21, align 4, !tbaa !5
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %365
  %367 = load i32, ptr %22, align 4, !tbaa !5
  %368 = sext i32 %367 to i64
  %369 = getelementptr inbounds [1001 x i32], ptr %366, i64 0, i64 %368
  %370 = load i32, ptr @mod, align 4, !tbaa !5
  %371 = load i32, ptr %21, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %372
  %374 = load i32, ptr %21, align 4, !tbaa !5
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [1001 x i32], ptr %373, i64 0, i64 %375
  %377 = load i32, ptr %376, align 4, !tbaa !5
  %378 = sub nsw i32 %370, %377
  %379 = load i32, ptr %21, align 4, !tbaa !5
  %380 = add nsw i32 %379, 1
  %381 = sext i32 %380 to i64
  %382 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %381
  %383 = load i32, ptr %22, align 4, !tbaa !5
  %384 = sext i32 %383 to i64
  %385 = getelementptr inbounds [1001 x i32], ptr %382, i64 0, i64 %384
  %386 = load i32, ptr %385, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %369, i32 noundef %378, i32 noundef %386)
  br label %387

387:                                              ; preds = %363
  %388 = load i32, ptr %22, align 4, !tbaa !5
  %389 = add nsw i32 %388, 1
  store i32 %389, ptr %22, align 4, !tbaa !5
  br label %357, !llvm.loop !26

390:                                              ; preds = %362
  br label %391

391:                                              ; preds = %390, %329
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %392 = load i32, ptr %21, align 4, !tbaa !5
  %393 = add nsw i32 %392, 1
  store i32 %393, ptr %24, align 4, !tbaa !5
  br label %394

394:                                              ; preds = %477, %391
  %395 = load i32, ptr %24, align 4, !tbaa !5
  %396 = icmp slt i32 %395, 1000
  br i1 %396, label %397, label %407

397:                                              ; preds = %394
  %398 = load i32, ptr %24, align 4, !tbaa !5
  %399 = sext i32 %398 to i64
  %400 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %399
  %401 = load i32, ptr %24, align 4, !tbaa !5
  %402 = sub nsw i32 %401, 1
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [1001 x i32], ptr %400, i64 0, i64 %403
  %405 = load i32, ptr %404, align 4, !tbaa !5
  %406 = icmp ne i32 %405, 0
  br label %407

407:                                              ; preds = %397, %394
  %408 = phi i1 [ false, %394 ], [ %406, %397 ]
  br i1 %408, label %410, label %409

409:                                              ; preds = %407
  store i32 38, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %480

410:                                              ; preds = %407
  %411 = load i32, ptr %23, align 4, !tbaa !5
  %412 = sext i32 %411 to i64
  %413 = load i32, ptr %24, align 4, !tbaa !5
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %414
  %416 = load i32, ptr %24, align 4, !tbaa !5
  %417 = sub nsw i32 %416, 1
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [1001 x i32], ptr %415, i64 0, i64 %418
  %420 = load i32, ptr %419, align 4, !tbaa !5
  %421 = sext i32 %420 to i64
  %422 = mul nsw i64 %412, %421
  %423 = load i32, ptr @mod, align 4, !tbaa !5
  %424 = sext i32 %423 to i64
  %425 = srem i64 %422, %424
  %426 = trunc i64 %425 to i32
  store i32 %426, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %427 = load i32, ptr %23, align 4, !tbaa !5
  %428 = sext i32 %427 to i64
  %429 = load i32, ptr @mod, align 4, !tbaa !5
  %430 = load i32, ptr %21, align 4, !tbaa !5
  %431 = sext i32 %430 to i64
  %432 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %431
  %433 = load i32, ptr %24, align 4, !tbaa !5
  %434 = sext i32 %433 to i64
  %435 = getelementptr inbounds [1001 x i32], ptr %432, i64 0, i64 %434
  %436 = load i32, ptr %435, align 4, !tbaa !5
  %437 = sub nsw i32 %429, %436
  %438 = sext i32 %437 to i64
  %439 = mul nsw i64 %428, %438
  %440 = load i32, ptr @mod, align 4, !tbaa !5
  %441 = sext i32 %440 to i64
  %442 = srem i64 %439, %441
  %443 = trunc i64 %442 to i32
  store i32 %443, ptr %25, align 4, !tbaa !5
  %444 = load i32, ptr %25, align 4, !tbaa !5
  %445 = icmp ne i32 %444, 0
  br i1 %445, label %447, label %446

446:                                              ; preds = %410
  store i32 40, ptr %12, align 4
  br label %474

447:                                              ; preds = %410
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %448

448:                                              ; preds = %470, %447
  %449 = load i32, ptr %26, align 4, !tbaa !5
  %450 = load i32, ptr %24, align 4, !tbaa !5
  %451 = sub nsw i32 1000, %450
  %452 = icmp slt i32 %449, %451
  br i1 %452, label %454, label %453

453:                                              ; preds = %448
  store i32 41, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %473

454:                                              ; preds = %448
  %455 = load i32, ptr %21, align 4, !tbaa !5
  %456 = sext i32 %455 to i64
  %457 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %456
  %458 = load i32, ptr %26, align 4, !tbaa !5
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds [1001 x i32], ptr %457, i64 0, i64 %459
  %461 = load i32, ptr %25, align 4, !tbaa !5
  %462 = load i32, ptr %24, align 4, !tbaa !5
  %463 = add nsw i32 %462, 1
  %464 = sext i32 %463 to i64
  %465 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %464
  %466 = load i32, ptr %26, align 4, !tbaa !5
  %467 = sext i32 %466 to i64
  %468 = getelementptr inbounds [1001 x i32], ptr %465, i64 0, i64 %467
  %469 = load i32, ptr %468, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %460, i32 noundef %461, i32 noundef %469)
  br label %470

470:                                              ; preds = %454
  %471 = load i32, ptr %26, align 4, !tbaa !5
  %472 = add nsw i32 %471, 1
  store i32 %472, ptr %26, align 4, !tbaa !5
  br label %448, !llvm.loop !27

473:                                              ; preds = %453
  store i32 0, ptr %12, align 4
  br label %474

474:                                              ; preds = %473, %446
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  %475 = load i32, ptr %12, align 4
  switch i32 %475, label %785 [
    i32 0, label %476
    i32 40, label %477
  ]

476:                                              ; preds = %474
  br label %477

477:                                              ; preds = %476, %474
  %478 = load i32, ptr %24, align 4, !tbaa !5
  %479 = add nsw i32 %478, 1
  store i32 %479, ptr %24, align 4, !tbaa !5
  br label %394, !llvm.loop !28

480:                                              ; preds = %409
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %481

481:                                              ; preds = %480
  %482 = load i32, ptr %21, align 4, !tbaa !5
  %483 = add nsw i32 %482, -1
  store i32 %483, ptr %21, align 4, !tbaa !5
  br label %325, !llvm.loop !29

484:                                              ; preds = %328
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ6solve8vE4ways, i8 0, i64 4008004, i1 false)
  store i32 1, ptr @_ZZ6solve8vE4ways, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 1, ptr %27, align 4, !tbaa !5
  br label %485

485:                                              ; preds = %523, %484
  %486 = load i32, ptr %27, align 4, !tbaa !5
  %487 = icmp sle i32 %486, 1000
  br i1 %487, label %489, label %488

488:                                              ; preds = %485
  store i32 44, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %526

489:                                              ; preds = %485
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %490

490:                                              ; preds = %519, %489
  %491 = load i32, ptr %28, align 4, !tbaa !5
  %492 = load i32, ptr @m, align 4, !tbaa !5
  %493 = icmp slt i32 %491, %492
  br i1 %493, label %495, label %494

494:                                              ; preds = %490
  store i32 47, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %522

495:                                              ; preds = %490
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %496 = load i32, ptr %28, align 4, !tbaa !5
  %497 = sext i32 %496 to i64
  %498 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %497
  store ptr %498, ptr %29, align 8, !tbaa !13
  %499 = load i32, ptr %27, align 4, !tbaa !5
  %500 = sext i32 %499 to i64
  %501 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %500
  %502 = load ptr, ptr %29, align 8, !tbaa !13
  %503 = getelementptr inbounds %struct.Edge, ptr %502, i32 0, i32 1
  %504 = load i32, ptr %503, align 4, !tbaa !17
  %505 = sub nsw i32 %504, 1
  %506 = sext i32 %505 to i64
  %507 = getelementptr inbounds [1001 x i32], ptr %501, i64 0, i64 %506
  %508 = load i32, ptr %27, align 4, !tbaa !5
  %509 = sub nsw i32 %508, 1
  %510 = sext i32 %509 to i64
  %511 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %510
  %512 = load ptr, ptr %29, align 8, !tbaa !13
  %513 = getelementptr inbounds %struct.Edge, ptr %512, i32 0, i32 0
  %514 = load i32, ptr %513, align 4, !tbaa !15
  %515 = sub nsw i32 %514, 1
  %516 = sext i32 %515 to i64
  %517 = getelementptr inbounds [1001 x i32], ptr %511, i64 0, i64 %516
  %518 = load i32, ptr %517, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %507, i32 noundef %518)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %519

519:                                              ; preds = %495
  %520 = load i32, ptr %28, align 4, !tbaa !5
  %521 = add nsw i32 %520, 1
  store i32 %521, ptr %28, align 4, !tbaa !5
  br label %490, !llvm.loop !30

522:                                              ; preds = %494
  br label %523

523:                                              ; preds = %522
  %524 = load i32, ptr %27, align 4, !tbaa !5
  %525 = add nsw i32 %524, 1
  store i32 %525, ptr %27, align 4, !tbaa !5
  br label %485, !llvm.loop !31

526:                                              ; preds = %488
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 2049, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #8
  %527 = load i32, ptr getelementptr inbounds ([1001 x i32], ptr @_ZZ6solve8vE4poly, i64 0, i64 1000), align 16, !tbaa !5
  %528 = icmp eq i32 %527, 1
  br i1 %528, label %529, label %530

529:                                              ; preds = %526
  br label %532

530:                                              ; preds = %526
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 582, ptr noundef @__PRETTY_FUNCTION__._Z6solve8v) #9
  unreachable

531:                                              ; No predecessors!
  br label %532

532:                                              ; preds = %531, %529
  store i32 1, ptr getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  store i32 1, ptr %32, align 4, !tbaa !5
  br label %533

533:                                              ; preds = %571, %532
  %534 = load i32, ptr %32, align 4, !tbaa !5
  %535 = icmp slt i32 %534, 999
  br i1 %535, label %537, label %536

536:                                              ; preds = %533
  store i32 50, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %574

537:                                              ; preds = %533
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %538

538:                                              ; preds = %555, %537
  %539 = load i32, ptr %34, align 4, !tbaa !5
  %540 = load i32, ptr %32, align 4, !tbaa !5
  %541 = icmp slt i32 %539, %540
  br i1 %541, label %543, label %542

542:                                              ; preds = %538
  store i32 53, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %558

543:                                              ; preds = %538
  %544 = load i32, ptr %34, align 4, !tbaa !5
  %545 = sext i32 %544 to i64
  %546 = getelementptr inbounds [1001 x i32], ptr getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 1), i64 0, i64 %545
  %547 = load i32, ptr %546, align 4, !tbaa !5
  %548 = load i32, ptr %32, align 4, !tbaa !5
  %549 = sub nsw i32 1000, %548
  %550 = load i32, ptr %34, align 4, !tbaa !5
  %551 = add nsw i32 %549, %550
  %552 = sext i32 %551 to i64
  %553 = getelementptr inbounds [1001 x i32], ptr @_ZZ6solve8vE4poly, i64 0, i64 %552
  %554 = load i32, ptr %553, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %33, i32 noundef %547, i32 noundef %554)
  br label %555

555:                                              ; preds = %543
  %556 = load i32, ptr %34, align 4, !tbaa !5
  %557 = add nsw i32 %556, 1
  store i32 %557, ptr %34, align 4, !tbaa !5
  br label %538, !llvm.loop !32

558:                                              ; preds = %542
  %559 = load i32, ptr %33, align 4, !tbaa !5
  %560 = icmp ne i32 %559, 0
  br i1 %560, label %561, label %565

561:                                              ; preds = %558
  %562 = load i32, ptr @mod, align 4, !tbaa !5
  %563 = load i32, ptr %33, align 4, !tbaa !5
  %564 = sub nsw i32 %562, %563
  br label %566

565:                                              ; preds = %558
  br label %566

566:                                              ; preds = %565, %561
  %567 = phi i32 [ %564, %561 ], [ 0, %565 ]
  %568 = load i32, ptr %32, align 4, !tbaa !5
  %569 = sext i32 %568 to i64
  %570 = getelementptr inbounds [1001 x i32], ptr getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 1), i64 0, i64 %569
  store i32 %567, ptr %570, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %571

571:                                              ; preds = %566
  %572 = load i32, ptr %32, align 4, !tbaa !5
  %573 = add nsw i32 %572, 1
  store i32 %573, ptr %32, align 4, !tbaa !5
  br label %533, !llvm.loop !33

574:                                              ; preds = %536
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %575 = getelementptr inbounds %class.anon.9, ptr %35, i32 0, i32 0
  store ptr %31, ptr %575, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %576

576:                                              ; preds = %601, %574
  %577 = load i32, ptr %36, align 4, !tbaa !5
  %578 = load i32, ptr @q, align 4, !tbaa !5
  %579 = icmp slt i32 %577, %578
  br i1 %579, label %581, label %580

580:                                              ; preds = %576
  store i32 56, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  br label %604

581:                                              ; preds = %576
  %582 = load i32, ptr %36, align 4, !tbaa !5
  %583 = sext i32 %582 to i64
  %584 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %583
  %585 = getelementptr inbounds [1001 x i32], ptr %584, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 4 %585, i8 0, i64 4000, i1 false)
  %586 = load i32, ptr %36, align 4, !tbaa !5
  %587 = sext i32 %586 to i64
  %588 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %587
  %589 = load i32, ptr %36, align 4, !tbaa !5
  %590 = sext i32 %589 to i64
  %591 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %590
  %592 = getelementptr inbounds %struct.Edge, ptr %591, i32 0, i32 2
  %593 = load i32, ptr %592, align 4, !tbaa !9
  %594 = srem i32 %593, 1000
  %595 = sext i32 %594 to i64
  %596 = getelementptr inbounds [1001 x i32], ptr %588, i64 0, i64 %595
  store i32 1, ptr %596, align 4, !tbaa !5
  %597 = load i32, ptr %36, align 4, !tbaa !5
  %598 = load i32, ptr %36, align 4, !tbaa !5
  %599 = sext i32 %598 to i64
  %600 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %599
  store i32 %597, ptr %600, align 4, !tbaa !5
  br label %601

601:                                              ; preds = %581
  %602 = load i32, ptr %36, align 4, !tbaa !5
  %603 = add nsw i32 %602, 1
  store i32 %603, ptr %36, align 4, !tbaa !5
  br label %576, !llvm.loop !34

604:                                              ; preds = %580
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %605

605:                                              ; preds = %628, %604
  %606 = load i32, ptr %37, align 4, !tbaa !5
  %607 = icmp slt i32 %606, 1000
  br i1 %607, label %609, label %608

608:                                              ; preds = %605
  store i32 59, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %631

609:                                              ; preds = %605
  %610 = load i32, ptr %37, align 4, !tbaa !5
  %611 = sext i32 %610 to i64
  %612 = getelementptr inbounds [1001 x i32], ptr @_ZZ6solve8vE4poly, i64 0, i64 %611
  %613 = load i32, ptr %612, align 4, !tbaa !5
  %614 = icmp ne i32 %613, 0
  br i1 %614, label %615, label %622

615:                                              ; preds = %609
  %616 = load i32, ptr @mod, align 4, !tbaa !5
  %617 = load i32, ptr %37, align 4, !tbaa !5
  %618 = sext i32 %617 to i64
  %619 = getelementptr inbounds [1001 x i32], ptr @_ZZ6solve8vE4poly, i64 0, i64 %618
  %620 = load i32, ptr %619, align 4, !tbaa !5
  %621 = sub nsw i32 %616, %620
  br label %623

622:                                              ; preds = %609
  br label %623

623:                                              ; preds = %622, %615
  %624 = phi i32 [ %621, %615 ], [ 0, %622 ]
  %625 = load i32, ptr %37, align 4, !tbaa !5
  %626 = sext i32 %625 to i64
  %627 = getelementptr inbounds [1001 x i32], ptr getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 3), i64 0, i64 %626
  store i32 %624, ptr %627, align 4, !tbaa !5
  br label %628

628:                                              ; preds = %623
  %629 = load i32, ptr %37, align 4, !tbaa !5
  %630 = add nsw i32 %629, 1
  store i32 %630, ptr %37, align 4, !tbaa !5
  br label %605, !llvm.loop !35

631:                                              ; preds = %608
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 4), ptr align 4 getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 3), i64 4000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  store i32 1000, ptr %38, align 4, !tbaa !5
  br label %632

632:                                              ; preds = %736, %631
  %633 = load ptr, ptr @stderr, align 8, !tbaa !13
  %634 = load i32, ptr %38, align 4, !tbaa !5
  %635 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %633, ptr noundef @.str.21, i32 noundef %634) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  store i32 0, ptr %39, align 4, !tbaa !5
  br label %636

636:                                              ; preds = %654, %632
  %637 = load i32, ptr %39, align 4, !tbaa !5
  %638 = load i32, ptr @q, align 4, !tbaa !5
  %639 = icmp slt i32 %637, %638
  br i1 %639, label %641, label %640

640:                                              ; preds = %636
  store i32 65, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %657

641:                                              ; preds = %636
  %642 = load i32, ptr %39, align 4, !tbaa !5
  %643 = sext i32 %642 to i64
  %644 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %643
  %645 = getelementptr inbounds %struct.Edge, ptr %644, i32 0, i32 2
  %646 = load i32, ptr %645, align 4, !tbaa !9
  %647 = load i32, ptr %38, align 4, !tbaa !5
  %648 = sdiv i32 %646, %647
  %649 = srem i32 %648, 10000
  %650 = load i32, ptr %39, align 4, !tbaa !5
  %651 = sext i32 %650 to i64
  %652 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %651
  %653 = getelementptr inbounds [1001 x i32], ptr %652, i64 0, i64 1000
  store i32 %649, ptr %653, align 4, !tbaa !5
  br label %654

654:                                              ; preds = %641
  %655 = load i32, ptr %39, align 4, !tbaa !5
  %656 = add nsw i32 %655, 1
  store i32 %656, ptr %39, align 4, !tbaa !5
  br label %636, !llvm.loop !36

657:                                              ; preds = %640
  %658 = load i32, ptr @q, align 4, !tbaa !5
  %659 = sext i32 %658 to i64
  %660 = getelementptr inbounds i32, ptr @_ZZ6solve8vE3ord, i64 %659
  call void @"_ZSt4sortIPiZ6solve8vE3$_2EvT_S2_T0_"(ptr noundef @_ZZ6solve8vE3ord, ptr noundef %660)
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  store i32 0, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  %661 = load i32, ptr %6, align 4, !tbaa !5
  %662 = load i32, ptr %38, align 4, !tbaa !5
  %663 = sdiv i32 %661, %662
  store i32 %663, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  store i32 9999, ptr %44, align 4, !tbaa !5
  %664 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %43, ptr noundef nonnull align 4 dereferenceable(4) %44)
  %665 = load i32, ptr %664, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  store i32 %665, ptr %42, align 4, !tbaa !5
  br label %666

666:                                              ; preds = %684, %657
  %667 = load i32, ptr %41, align 4, !tbaa !5
  %668 = load i32, ptr @q, align 4, !tbaa !5
  %669 = icmp slt i32 %667, %668
  br i1 %669, label %670, label %681

670:                                              ; preds = %666
  %671 = load i32, ptr %41, align 4, !tbaa !5
  %672 = sext i32 %671 to i64
  %673 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %672
  %674 = load i32, ptr %673, align 4, !tbaa !5
  %675 = sext i32 %674 to i64
  %676 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %675
  %677 = getelementptr inbounds [1001 x i32], ptr %676, i64 0, i64 1000
  %678 = load i32, ptr %677, align 4, !tbaa !5
  %679 = icmp ne i32 %678, 0
  %680 = xor i1 %679, true
  br label %681

681:                                              ; preds = %670, %666
  %682 = phi i1 [ false, %666 ], [ %680, %670 ]
  br i1 %682, label %683, label %687

683:                                              ; preds = %681
  br label %684

684:                                              ; preds = %683
  %685 = load i32, ptr %41, align 4, !tbaa !5
  %686 = add nsw i32 %685, 1
  store i32 %686, ptr %41, align 4, !tbaa !5
  br label %666, !llvm.loop !37

687:                                              ; preds = %681
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  store i32 1, ptr %45, align 4, !tbaa !5
  br label %688

688:                                              ; preds = %723, %687
  %689 = load i32, ptr %45, align 4, !tbaa !5
  %690 = load i32, ptr %42, align 4, !tbaa !5
  %691 = icmp sle i32 %689, %690
  br i1 %691, label %693, label %692

692:                                              ; preds = %688
  store i32 71, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  br label %726

693:                                              ; preds = %688
  br label %694

694:                                              ; preds = %719, %693
  %695 = load i32, ptr %41, align 4, !tbaa !5
  %696 = load i32, ptr @q, align 4, !tbaa !5
  %697 = icmp slt i32 %695, %696
  br i1 %697, label %698, label %709

698:                                              ; preds = %694
  %699 = load i32, ptr %41, align 4, !tbaa !5
  %700 = sext i32 %699 to i64
  %701 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %700
  %702 = load i32, ptr %701, align 4, !tbaa !5
  %703 = sext i32 %702 to i64
  %704 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %703
  %705 = getelementptr inbounds [1001 x i32], ptr %704, i64 0, i64 1000
  %706 = load i32, ptr %705, align 4, !tbaa !5
  %707 = load i32, ptr %45, align 4, !tbaa !5
  %708 = icmp eq i32 %706, %707
  br label %709

709:                                              ; preds = %698, %694
  %710 = phi i1 [ false, %694 ], [ %708, %698 ]
  br i1 %710, label %711, label %722

711:                                              ; preds = %709
  %712 = load i32, ptr %41, align 4, !tbaa !5
  %713 = sext i32 %712 to i64
  %714 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %713
  %715 = load i32, ptr %714, align 4, !tbaa !5
  %716 = sext i32 %715 to i64
  %717 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %716
  %718 = getelementptr inbounds [1001 x i32], ptr %717, i64 0, i64 0
  call void @"_ZZ6solve8vENK3$_1clEPiS0_"(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef %718, ptr noundef getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 4))
  br label %719

719:                                              ; preds = %711
  %720 = load i32, ptr %41, align 4, !tbaa !5
  %721 = add nsw i32 %720, 1
  store i32 %721, ptr %41, align 4, !tbaa !5
  br label %694, !llvm.loop !38

722:                                              ; preds = %709
  call void @"_ZZ6solve8vENK3$_1clEPiS0_"(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 4), ptr noundef getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 3))
  br label %723

723:                                              ; preds = %722
  %724 = load i32, ptr %45, align 4, !tbaa !5
  %725 = add nsw i32 %724, 1
  store i32 %725, ptr %45, align 4, !tbaa !5
  br label %688, !llvm.loop !39

726:                                              ; preds = %692
  %727 = load i32, ptr %6, align 4, !tbaa !5
  %728 = load i32, ptr %38, align 4, !tbaa !5
  %729 = sdiv i32 %727, %728
  %730 = icmp slt i32 %729, 10000
  br i1 %730, label %731, label %732

731:                                              ; preds = %726
  store i32 62, ptr %12, align 4
  br label %733

732:                                              ; preds = %726
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 3), ptr align 16 getelementptr inbounds ([1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 4), i64 4000, i1 false)
  store i32 0, ptr %12, align 4
  br label %733

733:                                              ; preds = %732, %731
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  %734 = load i32, ptr %12, align 4
  switch i32 %734, label %739 [
    i32 0, label %735
  ]

735:                                              ; preds = %733
  br label %736

736:                                              ; preds = %735
  %737 = load i32, ptr %38, align 4, !tbaa !5
  %738 = mul nsw i32 %737, 10000
  store i32 %738, ptr %38, align 4, !tbaa !5
  br label %632, !llvm.loop !40

739:                                              ; preds = %733
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %740

740:                                              ; preds = %739
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %741

741:                                              ; preds = %781, %740
  %742 = load i32, ptr %46, align 4, !tbaa !5
  %743 = load i32, ptr @q, align 4, !tbaa !5
  %744 = icmp slt i32 %742, %743
  br i1 %744, label %746, label %745

745:                                              ; preds = %741
  store i32 77, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %784

746:                                              ; preds = %741
  %747 = load i32, ptr %46, align 4, !tbaa !5
  %748 = sext i32 %747 to i64
  %749 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %748
  store i32 0, ptr %749, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  store i32 0, ptr %47, align 4, !tbaa !5
  br label %750

750:                                              ; preds = %777, %746
  %751 = load i32, ptr %47, align 4, !tbaa !5
  %752 = icmp slt i32 %751, 1000
  br i1 %752, label %754, label %753

753:                                              ; preds = %750
  store i32 80, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %780

754:                                              ; preds = %750
  %755 = load i32, ptr %46, align 4, !tbaa !5
  %756 = sext i32 %755 to i64
  %757 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %756
  %758 = load i32, ptr %46, align 4, !tbaa !5
  %759 = sext i32 %758 to i64
  %760 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %759
  %761 = load i32, ptr %47, align 4, !tbaa !5
  %762 = sext i32 %761 to i64
  %763 = getelementptr inbounds [1001 x i32], ptr %760, i64 0, i64 %762
  %764 = load i32, ptr %763, align 4, !tbaa !5
  %765 = load i32, ptr %47, align 4, !tbaa !5
  %766 = sext i32 %765 to i64
  %767 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %766
  %768 = load i32, ptr %46, align 4, !tbaa !5
  %769 = sext i32 %768 to i64
  %770 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %769
  %771 = getelementptr inbounds %struct.Edge, ptr %770, i32 0, i32 1
  %772 = load i32, ptr %771, align 4, !tbaa !17
  %773 = sub nsw i32 %772, 1
  %774 = sext i32 %773 to i64
  %775 = getelementptr inbounds [1001 x i32], ptr %767, i64 0, i64 %774
  %776 = load i32, ptr %775, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %757, i32 noundef %764, i32 noundef %776)
  br label %777

777:                                              ; preds = %754
  %778 = load i32, ptr %47, align 4, !tbaa !5
  %779 = add nsw i32 %778, 1
  store i32 %779, ptr %47, align 4, !tbaa !5
  br label %750, !llvm.loop !41

780:                                              ; preds = %753
  br label %781

781:                                              ; preds = %780
  %782 = load i32, ptr %46, align 4, !tbaa !5
  %783 = add nsw i32 %782, 1
  store i32 %783, ptr %46, align 4, !tbaa !5
  br label %741, !llvm.loop !42

784:                                              ; preds = %745
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #8
  ret void

785:                                              ; preds = %474
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ6solve8vE3$_2EvT_S2_T0_"(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ6solve8vENK3$_1clEPiS0_"(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!10, !6, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!10, !6, i64 4}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12}
!32 = distinct !{!32, !12}
!33 = distinct !{!33, !12}
!34 = distinct !{!34, !12}
!35 = distinct !{!35, !12}
!36 = distinct !{!36, !12}
!37 = distinct !{!37, !12}
!38 = distinct !{!38, !12}
!39 = distinct !{!39, !12}
!40 = distinct !{!40, !12}
!41 = distinct !{!41, !12}
!42 = distinct !{!42, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Edge = type { i32, i32, i32 }
%class.anon.7 = type { i8 }
%class.anon.9 = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@q = external dso_local local_unnamed_addr global i32, align 4
@mod = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local global [100001 x i32], align 16
@e = external dso_local local_unnamed_addr global [150001 x %struct.Edge], align 16
@que = external dso_local global [100001 x %struct.Edge], align 16
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._Z6solve8v = external hidden unnamed_addr constant [14 x i8], align 1
@_ZZ6solve8vE4ways = external hidden global [1001 x [1001 x i32]], align 16
@_ZZ6solve8vE4poly = external hidden global [1001 x [1001 x i32]], align 16
@_ZZ6solve8vE3ord = external hidden global [10001 x i32], align 16
@_ZZ6solve8vE3vec = external hidden global [10001 x [1001 x i32]], align 16
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7mod_invi(i32 noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6solve8v() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca %class.anon.7, align 1
  %3 = alloca i32, align 4
  %4 = alloca %class.anon.9, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp eq i32 %7, 1000
  %9 = load i32, ptr @q, align 4
  %10 = icmp eq i32 %9, 10000
  %11 = select i1 %8, i1 %10, i1 false
  br i1 %11, label %13, label %12

12:                                               ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, i32 noundef 491, ptr noundef nonnull @__PRETTY_FUNCTION__._Z6solve8v) #8
  unreachable

13:                                               ; preds = %0
  tail call void @_Z8NTT_initi(i32 noundef 11)
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %13
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.lr.ph

16:                                               ; preds = %.lr.ph
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %16, %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 0, ptr %1, align 4, !tbaa !5
  %17 = load i32, ptr @q, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph228, label %._crit_edge229

.lr.ph:                                           ; preds = %.lr.ph.preheader, %16
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %16 ]
  %19 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv, i32 2
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %16, label %22

22:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 494, ptr noundef nonnull @__PRETTY_FUNCTION__._Z6solve8v) #8
  unreachable

._crit_edge229:                                   ; preds = %36, %._crit_edge
  %23 = phi i32 [ 0, %._crit_edge ], [ %38, %36 ]
  %24 = load ptr, ptr @stderr, align 8, !tbaa !13
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.12, i32 noundef %23) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4008004) @_ZZ6solve8vE4ways, i8 0, i64 4008004, i1 false)
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph232.preheader, label %.lr.ph234.preheader

.lr.ph232.preheader:                              ; preds = %._crit_edge229
  %wide.trip.count302 = zext nneg i32 %26 to i64
  %xtraiter = and i64 %wide.trip.count302, 1
  %28 = icmp eq i32 %26, 1
  br i1 %28, label %.lr.ph234.preheader.loopexit.unr-lcssa, label %.lr.ph232.preheader.new

.lr.ph232.preheader.new:                          ; preds = %.lr.ph232.preheader
  %unroll_iter = and i64 %wide.trip.count302, 2147483646
  br label %.lr.ph232

.lr.ph228:                                        ; preds = %._crit_edge, %36
  %indvars.iv296 = phi i64 [ %indvars.iv.next297, %36 ], [ 0, %._crit_edge ]
  %29 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %indvars.iv296
  %30 = load i32, ptr %29, align 4, !tbaa !15
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %.critedge

32:                                               ; preds = %.lr.ph228
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = icmp slt i32 %34, 1000000001
  br i1 %35, label %36, label %.critedge

.critedge:                                        ; preds = %.lr.ph228, %32
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 498, ptr noundef nonnull @__PRETTY_FUNCTION__._Z6solve8v) #8
  unreachable

36:                                               ; preds = %32
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %1, align 4, !tbaa !5
  %indvars.iv.next297 = add nuw nsw i64 %indvars.iv296, 1
  %39 = load i32, ptr @q, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next297, %40
  br i1 %41, label %.lr.ph228, label %._crit_edge229, !llvm.loop !16

.lr.ph232:                                        ; preds = %.lr.ph232, %.lr.ph232.preheader.new
  %indvars.iv299 = phi i64 [ 0, %.lr.ph232.preheader.new ], [ %indvars.iv.next300.1, %.lr.ph232 ]
  %niter = phi i64 [ 0, %.lr.ph232.preheader.new ], [ %niter.next.1, %.lr.ph232 ]
  %42 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv299
  %43 = load i32, ptr %42, align 8, !tbaa !15
  %44 = add nsw i32 %43, -1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %42, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !17
  %48 = add nsw i32 %47, -1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %45, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !5
  %indvars.iv.next300 = or disjoint i64 %indvars.iv299, 1
  %53 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv.next300
  %54 = load i32, ptr %53, align 4, !tbaa !15
  %55 = add nsw i32 %54, -1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %53, i64 4
  %58 = load i32, ptr %57, align 8, !tbaa !17
  %59 = add nsw i32 %58, -1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %56, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %61, align 4, !tbaa !5
  %indvars.iv.next300.1 = add nuw nsw i64 %indvars.iv299, 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 %.lr.ph234.preheader.loopexit.unr-lcssa, label %.lr.ph232, !llvm.loop !18

.lr.ph234.preheader.loopexit.unr-lcssa:           ; preds = %.lr.ph232, %.lr.ph232.preheader
  %indvars.iv299.unr = phi i64 [ 0, %.lr.ph232.preheader ], [ %indvars.iv.next300.1, %.lr.ph232 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph234.preheader, label %.lr.ph232.epil

.lr.ph232.epil:                                   ; preds = %.lr.ph234.preheader.loopexit.unr-lcssa
  %64 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv299.unr
  %65 = load i32, ptr %64, align 4, !tbaa !15
  %66 = add nsw i32 %65, -1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %64, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !17
  %70 = add nsw i32 %69, -1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %67, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %72, align 4, !tbaa !5
  br label %.lr.ph234.preheader

.lr.ph234.preheader:                              ; preds = %.lr.ph232.epil, %.lr.ph234.preheader.loopexit.unr-lcssa, %._crit_edge229
  br label %.lr.ph234

.lr.ph234:                                        ; preds = %.lr.ph234.preheader, %.loopexit217
  %indvars.iv328 = phi i64 [ %indvars.iv.next329, %.loopexit217 ], [ 2, %.lr.ph234.preheader ]
  %indvars.iv310 = phi i64 [ %indvars.iv.next311, %.loopexit217 ], [ 0, %.lr.ph234.preheader ]
  %indvars.iv304 = phi i64 [ %indvars.iv.next305, %.loopexit217 ], [ 1, %.lr.ph234.preheader ]
  br label %77

75:                                               ; preds = %.loopexit217
  store i32 1, ptr getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 4004000), align 16, !tbaa !5
  br label %111

76:                                               ; preds = %77
  %indvars.iv.next307 = add nuw nsw i64 %indvars.iv306, 1
  %exitcond309.not = icmp eq i64 %indvars.iv.next307, 1000
  br i1 %exitcond309.not, label %.loopexit219, label %77, !llvm.loop !19

77:                                               ; preds = %.lr.ph234, %76
  %indvars.iv306 = phi i64 [ %indvars.iv304, %.lr.ph234 ], [ %indvars.iv.next307, %76 ]
  %78 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv306, i64 %indvars.iv310
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %.not205 = icmp eq i32 %79, 0
  br i1 %.not205, label %76, label %.lr.ph236

.lr.ph236:                                        ; preds = %77, %.lr.ph236
  %indvars.iv312 = phi i64 [ %indvars.iv.next313, %.lr.ph236 ], [ %indvars.iv310, %77 ]
  %80 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv304, i64 %indvars.iv312
  %81 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv306, i64 %indvars.iv312
  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) %80, ptr noundef nonnull align 4 dereferenceable(4) %81) #9
  %indvars.iv.next313 = add nuw nsw i64 %indvars.iv312, 1
  %exitcond315.not = icmp eq i64 %indvars.iv.next313, 1000
  br i1 %exitcond315.not, label %.preheader218, label %.lr.ph236, !llvm.loop !20

.preheader218:                                    ; preds = %.lr.ph236, %.preheader218
  %indvars.iv316 = phi i64 [ %indvars.iv.next317, %.preheader218 ], [ 0, %.lr.ph236 ]
  %82 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv316, i64 %indvars.iv306
  %83 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv316, i64 %indvars.iv304
  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) %82, ptr noundef nonnull align 4 dereferenceable(4) %83) #9
  %indvars.iv.next317 = add nuw nsw i64 %indvars.iv316, 1
  %exitcond319.not = icmp eq i64 %indvars.iv.next317, 1000
  br i1 %exitcond319.not, label %.loopexit219, label %.preheader218, !llvm.loop !21

.loopexit219:                                     ; preds = %76, %.preheader218
  %84 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv304, i64 %indvars.iv310
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %.not206 = icmp eq i32 %85, 0
  br i1 %.not206, label %.loopexit217, label %86

86:                                               ; preds = %.loopexit219
  %87 = call noundef i32 @_Z7mod_invi(i32 noundef %85)
  %88 = icmp ult i64 %indvars.iv310, 998
  br i1 %88, label %.lr.ph244, label %.loopexit217

.lr.ph244:                                        ; preds = %86
  %89 = sext i32 %87 to i64
  br label %90

90:                                               ; preds = %.lr.ph244, %.loopexit216
  %indvars.iv330 = phi i64 [ %indvars.iv328, %.lr.ph244 ], [ %indvars.iv.next331, %.loopexit216 ]
  %91 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv330, i64 %indvars.iv310
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %.not207 = icmp eq i32 %92, 0
  br i1 %.not207, label %.loopexit216, label %.lr.ph240

.lr.ph240:                                        ; preds = %90
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %89
  %95 = load i32, ptr @mod, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = srem i64 %94, %96
  %98 = trunc nsw i64 %97 to i32
  br label %99

99:                                               ; preds = %.lr.ph240, %99
  %indvars.iv320 = phi i64 [ %indvars.iv310, %.lr.ph240 ], [ %indvars.iv.next321, %99 ]
  %100 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv330, i64 %indvars.iv320
  %101 = load i32, ptr @mod, align 4, !tbaa !5
  %102 = sub nsw i32 %101, %98
  %103 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv304, i64 %indvars.iv320
  %104 = load i32, ptr %103, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %100, i32 noundef %102, i32 noundef %104)
  %indvars.iv.next321 = add nuw nsw i64 %indvars.iv320, 1
  %exitcond323.not = icmp eq i64 %indvars.iv.next321, 1000
  br i1 %exitcond323.not, label %.preheader215, label %99, !llvm.loop !22

.preheader215:                                    ; preds = %99, %.preheader215
  %indvars.iv324 = phi i64 [ %indvars.iv.next325, %.preheader215 ], [ 0, %99 ]
  %105 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv324, i64 %indvars.iv304
  %106 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv324, i64 %indvars.iv330
  %107 = load i32, ptr %106, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %105, i32 noundef %98, i32 noundef %107)
  %indvars.iv.next325 = add nuw nsw i64 %indvars.iv324, 1
  %exitcond327.not = icmp eq i64 %indvars.iv.next325, 1000
  br i1 %exitcond327.not, label %.loopexit216, label %.preheader215, !llvm.loop !23

.loopexit216:                                     ; preds = %.preheader215, %90
  %indvars.iv.next331 = add nuw nsw i64 %indvars.iv330, 1
  %exitcond333.not = icmp eq i64 %indvars.iv.next331, 1000
  br i1 %exitcond333.not, label %.loopexit217, label %90, !llvm.loop !24

.loopexit217:                                     ; preds = %.loopexit216, %86, %.loopexit219
  %indvars.iv.next305 = add nuw nsw i64 %indvars.iv304, 1
  %indvars.iv.next311 = add nuw nsw i64 %indvars.iv310, 1
  %indvars.iv.next329 = add nuw nsw i64 %indvars.iv328, 1
  %exitcond337.not = icmp eq i64 %indvars.iv.next311, 999
  br i1 %exitcond337.not, label %75, label %.lr.ph234, !llvm.loop !25

108:                                              ; preds = %.critedge2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4008004) @_ZZ6solve8vE4ways, i8 0, i64 4008004, i1 false)
  store i32 1, ptr @_ZZ6solve8vE4ways, align 16, !tbaa !5
  %109 = load i32, ptr @m, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.preheader211, label %.split262.us

111:                                              ; preds = %75, %.critedge2
  %indvars.iv356 = phi i64 [ 999, %75 ], [ %indvars.iv.next357, %.critedge2 ]
  %indvars.iv354 = phi i64 [ 1, %75 ], [ %indvars.iv.next355, %.critedge2 ]
  %indvars.iv348 = phi i64 [ 1000, %75 ], [ %indvars.iv.next349, %.critedge2 ]
  %112 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %indvars.iv356
  store i32 0, ptr %112, align 4, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %112, i64 4
  %114 = add nuw nsw i64 %indvars.iv356, 1
  %115 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %114
  %116 = shl i64 %indvars.iv356, 2
  %117 = sub i64 4000, %116
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %113, ptr nonnull align 4 %115, i64 %117, i1 false)
  %118 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv356, i64 %indvars.iv356
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %.not201.not = icmp eq i32 %119, 0
  br i1 %.not201.not, label %.loopexit214, label %.lr.ph247

.lr.ph247:                                        ; preds = %111, %.lr.ph247
  %indvars.iv338 = phi i64 [ %indvars.iv.next339, %.lr.ph247 ], [ 0, %111 ]
  %120 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %indvars.iv356, i64 %indvars.iv338
  %121 = load i32, ptr @mod, align 4, !tbaa !5
  %122 = load i32, ptr %118, align 4, !tbaa !5
  %123 = sub nsw i32 %121, %122
  %124 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %114, i64 %indvars.iv338
  %125 = load i32, ptr %124, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %120, i32 noundef %123, i32 noundef %125)
  %indvars.iv.next339 = add nuw nsw i64 %indvars.iv338, 1
  %exitcond344.not = icmp eq i64 %indvars.iv.next339, %indvars.iv354
  br i1 %exitcond344.not, label %.loopexit214, label %.lr.ph247, !llvm.loop !26

.loopexit214:                                     ; preds = %.lr.ph247, %111
  %126 = icmp ult i64 %indvars.iv356, 999
  br i1 %126, label %.lr.ph254, label %.critedge2

.lr.ph254:                                        ; preds = %.loopexit214, %.loopexit
  %indvars.iv350 = phi i64 [ %indvars.iv.next351, %.loopexit ], [ %indvars.iv348, %.loopexit214 ]
  %.0181250 = phi i64 [ %135, %.loopexit ], [ 1, %.loopexit214 ]
  %127 = add nsw i64 %indvars.iv350, -1
  %128 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv350, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %.not202 = icmp eq i32 %129, 0
  br i1 %.not202, label %.critedge2, label %130

.critedge2:                                       ; preds = %.lr.ph254, %.loopexit, %.loopexit214
  %indvars.iv.next357 = add nsw i64 %indvars.iv356, -1
  %indvars.iv.next355 = add nuw nsw i64 %indvars.iv354, 1
  %indvars.iv.next349 = add nsw i64 %indvars.iv348, -1
  %exitcond361.not = icmp eq i64 %indvars.iv.next355, 1001
  br i1 %exitcond361.not, label %108, label %111, !llvm.loop !27

130:                                              ; preds = %.lr.ph254
  %131 = sext i32 %129 to i64
  %132 = mul nsw i64 %.0181250, %131
  %133 = load i32, ptr @mod, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = srem i64 %132, %134
  %136 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv356, i64 %indvars.iv350
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sub nsw i32 %133, %137
  %139 = sext i32 %138 to i64
  %140 = mul nsw i64 %135, %139
  %141 = srem i64 %140, %134
  %142 = trunc nsw i64 %141 to i32
  %.not204 = icmp eq i64 %141, 0
  br i1 %.not204, label %.loopexit, label %.preheader212

.preheader212:                                    ; preds = %130
  %143 = sub nsw i64 1000, %indvars.iv350
  %144 = icmp ult i64 %indvars.iv350, 1000
  br i1 %144, label %.lr.ph249, label %.loopexit

.lr.ph249:                                        ; preds = %.preheader212
  %145 = add nuw nsw i64 %indvars.iv350, 1
  br label %146

146:                                              ; preds = %.lr.ph249, %146
  %indvars.iv345 = phi i64 [ 0, %.lr.ph249 ], [ %indvars.iv.next346, %146 ]
  %147 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %indvars.iv356, i64 %indvars.iv345
  %148 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4poly, i64 0, i64 %145, i64 %indvars.iv345
  %149 = load i32, ptr %148, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %147, i32 noundef %142, i32 noundef %149)
  %indvars.iv.next346 = add nuw nsw i64 %indvars.iv345, 1
  %150 = icmp slt i64 %indvars.iv.next346, %143
  br i1 %150, label %146, label %.loopexit, !llvm.loop !28

.loopexit:                                        ; preds = %146, %.preheader212, %130
  %indvars.iv.next351 = add nuw nsw i64 %indvars.iv350, 1
  %exitcond353.not = icmp eq i64 %indvars.iv.next351, 1000
  br i1 %exitcond353.not, label %.critedge2, label %.lr.ph254, !llvm.loop !29

.preheader211:                                    ; preds = %108, %._crit_edge259
  %151 = phi i32 [ %156, %._crit_edge259 ], [ %109, %108 ]
  %indvars.iv365 = phi i64 [ %indvars.iv.next366, %._crit_edge259 ], [ 1, %108 ]
  %152 = icmp sgt i32 %151, 0
  br i1 %152, label %.lr.ph258, label %._crit_edge259

.lr.ph258:                                        ; preds = %.preheader211
  %153 = add nsw i64 %indvars.iv365, -1
  br label %157

.split262.us:                                     ; preds = %._crit_edge259, %108
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #9
  %154 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 4000), align 16, !tbaa !5
  %155 = icmp eq i32 %154, 1
  br i1 %155, label %173, label %172

._crit_edge259:                                   ; preds = %157, %.preheader211
  %156 = phi i32 [ %151, %.preheader211 ], [ %169, %157 ]
  %indvars.iv.next366 = add nuw nsw i64 %indvars.iv365, 1
  %exitcond368.not = icmp eq i64 %indvars.iv.next366, 1001
  br i1 %exitcond368.not, label %.split262.us, label %.preheader211, !llvm.loop !30

157:                                              ; preds = %.lr.ph258, %157
  %indvars.iv362 = phi i64 [ 0, %.lr.ph258 ], [ %indvars.iv.next363, %157 ]
  %158 = getelementptr inbounds [150001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv362
  %159 = getelementptr inbounds i8, ptr %158, i64 4
  %160 = load i32, ptr %159, align 4, !tbaa !17
  %161 = add nsw i32 %160, -1
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv365, i64 %162
  %164 = load i32, ptr %158, align 4, !tbaa !15
  %165 = add nsw i32 %164, -1
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %153, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %163, i32 noundef %168)
  %indvars.iv.next363 = add nuw nsw i64 %indvars.iv362, 1
  %169 = load i32, ptr @m, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = icmp slt i64 %indvars.iv.next363, %170
  br i1 %171, label %157, label %._crit_edge259, !llvm.loop !32

172:                                              ; preds = %.split262.us
  call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 582, ptr noundef nonnull @__PRETTY_FUNCTION__._Z6solve8v) #8
  unreachable

173:                                              ; preds = %.split262.us
  store i32 1, ptr getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 4004), align 4, !tbaa !5
  br label %177

174:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store ptr %2, ptr %4, align 8, !tbaa !13
  %175 = load i32, ptr @q, align 4, !tbaa !5
  %176 = icmp sgt i32 %175, 0
  br i1 %176, label %.lr.ph267.preheader, label %vector.ph

.lr.ph267.preheader:                              ; preds = %174
  %wide.trip.count382 = zext nneg i32 %175 to i64
  br label %.lr.ph267

177:                                              ; preds = %173, %178
  %indvars.iv375 = phi i64 [ 1, %173 ], [ %indvars.iv.next376, %178 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %184

178:                                              ; preds = %184
  %179 = load i32, ptr %3, align 4
  %.not200 = icmp eq i32 %179, 0
  %180 = load i32, ptr @mod, align 4
  %181 = sub nsw i32 %180, %179
  %182 = select i1 %.not200, i32 0, i32 %181
  %183 = getelementptr inbounds [1001 x i32], ptr getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 4004), i64 0, i64 %indvars.iv375
  store i32 %182, ptr %183, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %indvars.iv.next376 = add nuw nsw i64 %indvars.iv375, 1
  %exitcond378.not = icmp eq i64 %indvars.iv.next376, 999
  br i1 %exitcond378.not, label %174, label %177, !llvm.loop !33

184:                                              ; preds = %177, %184
  %indvars.iv369 = phi i64 [ 0, %177 ], [ %indvars.iv.next370, %184 ]
  %185 = getelementptr inbounds [1001 x i32], ptr getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 4004), i64 0, i64 %indvars.iv369
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sub nsw i64 %indvars.iv369, %indvars.iv375
  %188 = add nsw i64 %187, 1000
  %189 = getelementptr inbounds [1001 x i32], ptr @_ZZ6solve8vE4poly, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %186, i32 noundef %190)
  %indvars.iv.next370 = add nuw nsw i64 %indvars.iv369, 1
  %exitcond374.not = icmp eq i64 %indvars.iv.next370, %indvars.iv375
  br i1 %exitcond374.not, label %178, label %184, !llvm.loop !34

vector.ph:                                        ; preds = %.lr.ph267, %174
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %180, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %191 = getelementptr inbounds [1001 x i32], ptr @_ZZ6solve8vE4poly, i64 0, i64 %index
  %192 = getelementptr inbounds i8, ptr %191, i64 16
  %wide.load = load <4 x i32>, ptr %191, align 16, !tbaa !5
  %wide.load422 = load <4 x i32>, ptr %192, align 16, !tbaa !5
  %193 = icmp eq <4 x i32> %wide.load, zeroinitializer
  %194 = icmp eq <4 x i32> %wide.load422, zeroinitializer
  %195 = sub nsw <4 x i32> %broadcast.splat, %wide.load
  %196 = sub nsw <4 x i32> %broadcast.splat, %wide.load422
  %197 = select <4 x i1> %193, <4 x i32> zeroinitializer, <4 x i32> %195
  %198 = select <4 x i1> %194, <4 x i32> zeroinitializer, <4 x i32> %196
  %199 = getelementptr inbounds [1001 x i32], ptr getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 12012), i64 0, i64 %index
  %200 = getelementptr inbounds i8, ptr %199, i64 16
  store <4 x i32> %197, ptr %199, align 4, !tbaa !5
  store <4 x i32> %198, ptr %200, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %201 = icmp eq i64 %index.next, 1000
  br i1 %201, label %middle.block, label %vector.body, !llvm.loop !35

.lr.ph267:                                        ; preds = %.lr.ph267.preheader, %.lr.ph267
  %indvars.iv379 = phi i64 [ 0, %.lr.ph267.preheader ], [ %indvars.iv.next380, %.lr.ph267 ]
  %202 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %indvars.iv379
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(4000) %202, i8 0, i64 4000, i1 false)
  %203 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %indvars.iv379, i32 2
  %204 = load i32, ptr %203, align 4, !tbaa !11
  %205 = srem i32 %204, 1000
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %indvars.iv379, i64 %206
  store i32 1, ptr %207, align 4, !tbaa !5
  %208 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %indvars.iv379
  %209 = trunc nuw nsw i64 %indvars.iv379 to i32
  store i32 %209, ptr %208, align 4, !tbaa !5
  %indvars.iv.next380 = add nuw nsw i64 %indvars.iv379, 1
  %exitcond383.not = icmp eq i64 %indvars.iv.next380, %wide.trip.count382
  br i1 %exitcond383.not, label %vector.ph, label %.lr.ph267, !llvm.loop !38

middle.block:                                     ; preds = %vector.body
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 16016), ptr noundef nonnull align 4 dereferenceable(4000) getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 12012), i64 4000, i1 false)
  br label %210

210:                                              ; preds = %255, %middle.block
  %.0169 = phi i32 [ 1000, %middle.block ], [ %256, %255 ]
  %211 = load ptr, ptr @stderr, align 8, !tbaa !13
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %211, ptr noundef nonnull @.str.21, i32 noundef %.0169) #10
  %213 = load i32, ptr @q, align 4, !tbaa !5
  %214 = icmp sgt i32 %213, 0
  br i1 %214, label %.lr.ph271.preheader, label %._crit_edge272

.lr.ph271.preheader:                              ; preds = %210
  %wide.trip.count391 = zext nneg i32 %213 to i64
  br label %.lr.ph271

._crit_edge272:                                   ; preds = %.lr.ph271, %210
  %215 = sext i32 %213 to i64
  %216 = getelementptr inbounds i32, ptr @_ZZ6solve8vE3ord, i64 %215
  call void @"_ZSt4sortIPiZ6solve8vE3$_2EvT_S2_T0_"(ptr noundef nonnull @_ZZ6solve8vE3ord, ptr noundef nonnull %216)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %217 = load i32, ptr %1, align 4, !tbaa !5
  %218 = sdiv i32 %217, %.0169
  store i32 %218, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  store i32 9999, ptr %6, align 4, !tbaa !5
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %220 = load i32, ptr %219, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  %221 = load i32, ptr @q, align 4, !tbaa !5
  %222 = icmp sgt i32 %221, 0
  br i1 %222, label %.lr.ph275.preheader, label %.critedge4

.lr.ph275.preheader:                              ; preds = %._crit_edge272
  %wide.trip.count396 = zext nneg i32 %221 to i64
  br label %.lr.ph275

.lr.ph271:                                        ; preds = %.lr.ph271.preheader, %.lr.ph271
  %indvars.iv388 = phi i64 [ 0, %.lr.ph271.preheader ], [ %indvars.iv.next389, %.lr.ph271 ]
  %223 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %indvars.iv388, i32 2
  %224 = load i32, ptr %223, align 4, !tbaa !11
  %225 = sdiv i32 %224, %.0169
  %226 = srem i32 %225, 10000
  %227 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %indvars.iv388, i64 1000
  store i32 %226, ptr %227, align 4, !tbaa !5
  %indvars.iv.next389 = add nuw nsw i64 %indvars.iv388, 1
  %exitcond392.not = icmp eq i64 %indvars.iv.next389, %wide.trip.count391
  br i1 %exitcond392.not, label %._crit_edge272, label %.lr.ph271, !llvm.loop !39

.lr.ph275:                                        ; preds = %.lr.ph275.preheader, %233
  %indvars.iv393 = phi i64 [ 0, %.lr.ph275.preheader ], [ %indvars.iv.next394, %233 ]
  %228 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %indvars.iv393
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %230, i64 1000
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %.not = icmp eq i32 %232, 0
  br i1 %.not, label %233, label %.critedge4.loopexit.split.loop.exit415

233:                                              ; preds = %.lr.ph275
  %indvars.iv.next394 = add nuw nsw i64 %indvars.iv393, 1
  %exitcond397.not = icmp eq i64 %indvars.iv.next394, %wide.trip.count396
  br i1 %exitcond397.not, label %.critedge4, label %.lr.ph275, !llvm.loop !40

.critedge4.loopexit.split.loop.exit415:           ; preds = %.lr.ph275
  %234 = trunc nuw nsw i64 %indvars.iv393 to i32
  br label %.critedge4

.critedge4:                                       ; preds = %233, %.critedge4.loopexit.split.loop.exit415, %._crit_edge272
  %.0167.lcssa = phi i32 [ 0, %._crit_edge272 ], [ %234, %.critedge4.loopexit.split.loop.exit415 ], [ %221, %233 ]
  %.not198284 = icmp slt i32 %220, 1
  br i1 %.not198284, label %._crit_edge287, label %.preheader

.preheader:                                       ; preds = %.critedge4, %.critedge6
  %.0165286 = phi i32 [ %254, %.critedge6 ], [ 1, %.critedge4 ]
  %.1285 = phi i32 [ %.2.lcssa, %.critedge6 ], [ %.0167.lcssa, %.critedge4 ]
  %235 = load i32, ptr @q, align 4, !tbaa !5
  %236 = icmp slt i32 %.1285, %235
  br i1 %236, label %.lr.ph280.preheader, label %.critedge6

.lr.ph280.preheader:                              ; preds = %.preheader
  %237 = sext i32 %.1285 to i64
  br label %.lr.ph280

._crit_edge287:                                   ; preds = %.critedge6, %.critedge4
  %238 = load i32, ptr %1, align 4, !tbaa !5
  %239 = sdiv i32 %238, %.0169
  %240 = icmp sgt i32 %239, 9999
  br i1 %240, label %255, label %.critedge209.preheader

.critedge209.preheader:                           ; preds = %._crit_edge287
  %241 = load i32, ptr @q, align 4, !tbaa !5
  %242 = icmp sgt i32 %241, 0
  br i1 %242, label %.lr.ph290, label %.critedge209._crit_edge

.lr.ph280:                                        ; preds = %.lr.ph280.preheader, %250
  %indvars.iv398 = phi i64 [ %237, %.lr.ph280.preheader ], [ %indvars.iv.next399, %250 ]
  %243 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve8vE3ord, i64 0, i64 %indvars.iv398
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %245
  %247 = getelementptr inbounds i8, ptr %246, i64 4000
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = icmp eq i32 %248, %.0165286
  br i1 %249, label %250, label %.critedge6.loopexit

250:                                              ; preds = %.lr.ph280
  call void @"_ZZ6solve8vENK3$_1clEPiS0_"(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %246, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 16016))
  %indvars.iv.next399 = add nsw i64 %indvars.iv398, 1
  %251 = load i32, ptr @q, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = icmp slt i64 %indvars.iv.next399, %252
  br i1 %253, label %.lr.ph280, label %.critedge6.loopexit, !llvm.loop !41

.critedge6.loopexit:                              ; preds = %250, %.lr.ph280
  %.2.lcssa.ph.in = phi i64 [ %indvars.iv398, %.lr.ph280 ], [ %indvars.iv.next399, %250 ]
  %.2.lcssa.ph = trunc i64 %.2.lcssa.ph.in to i32
  br label %.critedge6

.critedge6:                                       ; preds = %.critedge6.loopexit, %.preheader
  %.2.lcssa = phi i32 [ %.1285, %.preheader ], [ %.2.lcssa.ph, %.critedge6.loopexit ]
  call void @"_ZZ6solve8vENK3$_1clEPiS0_"(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 16016), ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 12012))
  %254 = add nuw i32 %.0165286, 1
  %exitcond401.not = icmp eq i32 %.0165286, %220
  br i1 %exitcond401.not, label %._crit_edge287, label %.preheader, !llvm.loop !42

255:                                              ; preds = %._crit_edge287
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(4000) getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 12012), ptr noundef nonnull align 16 dereferenceable(4000) getelementptr inbounds (i8, ptr @_ZZ6solve8vE4poly, i64 16016), i64 4000, i1 false)
  %256 = mul nuw nsw i32 %.0169, 10000
  br label %210, !llvm.loop !43

.critedge209._crit_edge:                          ; preds = %.critedge209, %.critedge209.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret void

.lr.ph290:                                        ; preds = %.critedge209.preheader, %.critedge209
  %indvars.iv407 = phi i64 [ %indvars.iv.next408, %.critedge209 ], [ 0, %.critedge209.preheader ]
  %257 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv407
  store i32 0, ptr %257, align 4, !tbaa !5
  %258 = getelementptr inbounds [100001 x %struct.Edge], ptr @que, i64 0, i64 %indvars.iv407, i32 1
  br label %262

.critedge209:                                     ; preds = %262
  %indvars.iv.next408 = add nuw nsw i64 %indvars.iv407, 1
  %259 = load i32, ptr @q, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = icmp slt i64 %indvars.iv.next408, %260
  br i1 %261, label %.lr.ph290, label %.critedge209._crit_edge, !llvm.loop !44

262:                                              ; preds = %.lr.ph290, %262
  %indvars.iv402 = phi i64 [ 0, %.lr.ph290 ], [ %indvars.iv.next403, %262 ]
  %263 = getelementptr inbounds [10001 x [1001 x i32]], ptr @_ZZ6solve8vE3vec, i64 0, i64 %indvars.iv407, i64 %indvars.iv402
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = load i32, ptr %258, align 4, !tbaa !17
  %266 = add nsw i32 %265, -1
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [1001 x [1001 x i32]], ptr @_ZZ6solve8vE4ways, i64 0, i64 %indvars.iv402, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  call void @_Z11mod_inc_mulRiii(ptr noundef nonnull align 4 dereferenceable(4) %257, i32 noundef %264, i32 noundef %269)
  %indvars.iv.next403 = add nuw nsw i64 %indvars.iv402, 1
  %exitcond406.not = icmp eq i64 %indvars.iv.next403, 1000
  br i1 %exitcond406.not, label %.critedge209, label %262, !llvm.loop !45
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ6solve8vE3$_2EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ6solve8vENK3$_1clEPiS0_"(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { cold 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 = !{!12, !6, i64 8}
!12 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!12, !6, i64 0}
!16 = distinct !{!16, !10}
!17 = !{!12, !6, i64 4}
!18 = distinct !{!18, !10}
!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 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10, !31}
!31 = !{!"llvm.loop.unswitch.partial.disable"}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !10, !36, !37}
!36 = !{!"llvm.loop.isvectorized", i32 1}
!37 = !{!"llvm.loop.unroll.runtime.disable"}
!38 = distinct !{!38, !10}
!39 = distinct !{!39, !10}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !10}
!43 = distinct !{!43, !10}
!44 = distinct !{!44, !10}
!45 = distinct !{!45, !10}


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