; LLVM IR from tangjz/acm-icpc :: codeforces/gym/101194I.ll (Z6solve2v)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@inv = external dso_local global [10001 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@c = external dso_local global [101 x i32], align 16
@coeff = external dso_local global [2 x [10001 x i32]], align 16
@_ZZ6solve2vE3low = external hidden global [101 x i32], align 16
@_ZZ6solve2vE3vis = external hidden global [10001 x i8], align 16
@_ZZ6solve2vE3rem = external hidden global [10001 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) #0

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6solve2v() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::priority_queue", align 8
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", 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 i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #5
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %30 = load i32, ptr @c, align 16, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = mul i64 %31, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ6solve2vE3low, i8 63, i64 %32, i1 false)
  %33 = load i32, ptr @c, align 16, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = mul i64 %34, 1
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ6solve2vE3vis, i8 0, i64 %35, i1 false)
  store i32 0, ptr @_ZZ6solve2vE3low, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %36 = load i32, ptr @_ZZ6solve2vE3low, align 16, !tbaa !5
  %37 = sub nsw i32 0, %36
  store i32 %37, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  %38 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %39 unwind label %57

39:                                               ; preds = %0
  store i64 %38, ptr %3, align 4
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(8) %3)
          to label %40 unwind label %57

40:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %41

41:                                               ; preds = %122, %120, %40
  %42 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %43 unwind label %61

43:                                               ; preds = %41
  %44 = xor i1 %42, true
  br i1 %44, label %45, label %124

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %46 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %47 unwind label %65

47:                                               ; preds = %45
  %48 = getelementptr inbounds %"struct.std::pair", ptr %46, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !9
  store i32 %49, ptr %8, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %50 unwind label %65

50:                                               ; preds = %47
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !11, !range !13, !noundef !14
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %69

56:                                               ; preds = %50
  store i32 2, ptr %9, align 4
  br label %120, !llvm.loop !15

57:                                               ; preds = %39, %0
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %6, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %413

61:                                               ; preds = %41
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  br label %413

65:                                               ; preds = %47, %45
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %6, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %7, align 4
  br label %123

69:                                               ; preds = %50
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %71
  store i8 1, ptr %72, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %116, %69
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %119

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %79, %83
  %85 = load i32, ptr @c, align 16, !tbaa !5
  %86 = srem i32 %84, %85
  store i32 %86, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 %90, %94
  store i32 %95, ptr %12, align 4, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp slt i32 %96, %100
  br i1 %101, label %102, label %115

102:                                              ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !5
  %107 = sub nsw i32 0, %103
  store i32 %107, ptr %14, align 4, !tbaa !5
  %108 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %109 unwind label %111

109:                                              ; preds = %102
  store i64 %108, ptr %13, align 4
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %110 unwind label %111

110:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %115

111:                                              ; preds = %109, %102
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %6, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %123

115:                                              ; preds = %110, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %10, align 4, !tbaa !5
  br label %73, !llvm.loop !17

119:                                              ; preds = %77
  store i32 0, ptr %9, align 4
  br label %120

120:                                              ; preds = %119, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %121 = load i32, ptr %9, align 4
  switch i32 %121, label %419 [
    i32 0, label %122
    i32 2, label %41
  ]

122:                                              ; preds = %120
  br label %41, !llvm.loop !15

123:                                              ; preds = %111, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %413

124:                                              ; preds = %43
  %125 = load i32, ptr @p, align 4, !tbaa !5
  %126 = icmp eq i32 %125, 100
  br i1 %126, label %127, label %191

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %128 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %128, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %179, %127
  %130 = load i32, ptr %16, align 4, !tbaa !5
  %131 = load i32, ptr @c, align 16, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %182

134:                                              ; preds = %129
  %135 = load i32, ptr %16, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = icmp slt i32 %138, 1061109567
  br i1 %139, label %140, label %178

140:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = load i32, ptr %16, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %151, label %164

151:                                              ; preds = %140
  %152 = load i32, ptr @n, align 4, !tbaa !5
  %153 = load i32, ptr %16, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sub nsw i32 %152, %156
  %158 = sub nsw i32 %157, 1
  %159 = load i32, ptr @c, align 16, !tbaa !5
  %160 = sdiv i32 %158, %159
  %161 = add nsw i32 %160, 1
  %162 = load i32, ptr @c, align 16, !tbaa !5
  %163 = mul nsw i32 %161, %162
  br label %165

164:                                              ; preds = %140
  br label %165

165:                                              ; preds = %164, %151
  %166 = phi i32 [ %163, %151 ], [ 0, %164 ]
  %167 = add nsw i32 %144, %166
  store i32 %167, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %168 = load i32, ptr %17, align 4, !tbaa !5
  %169 = load i32, ptr @n, align 4, !tbaa !5
  %170 = sub nsw i32 %168, %169
  store i32 %170, ptr %18, align 4, !tbaa !5
  %171 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %172 unwind label %174

172:                                              ; preds = %165
  %173 = load i32, ptr %171, align 4, !tbaa !5
  store i32 %173, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %178

174:                                              ; preds = %165
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %6, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %413

178:                                              ; preds = %172, %134
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %16, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %16, align 4, !tbaa !5
  br label %129, !llvm.loop !18

182:                                              ; preds = %133
  %183 = load i32, ptr %15, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = load i32, ptr @n, align 4, !tbaa !5
  %186 = call noundef i32 @_Z7mod_powii(i32 noundef 100, i32 noundef %185)
  %187 = sext i32 %186 to i64
  %188 = mul nsw i64 %184, %187
  %189 = srem i64 %188, 1000000007
  %190 = trunc i64 %189 to i32
  store i32 %190, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %411

191:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %192 = load i32, ptr @m, align 4, !tbaa !5
  %193 = sub nsw i32 %192, 2
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = load i32, ptr @m, align 4, !tbaa !5
  %198 = sub nsw i32 %197, 1
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = mul nsw i32 %196, %201
  store i32 %202, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %203 = load i32, ptr %20, align 4, !tbaa !5
  %204 = sub nsw i32 %203, 1
  store i32 %204, ptr %21, align 4, !tbaa !5
  %205 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z5solveii(i32 noundef 0, i32 noundef %205)
          to label %206 unwind label %215

206:                                              ; preds = %191
  %207 = load i32, ptr %20, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = mul i64 %208, 1
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ6solve2vE3vis, i8 0, i64 %209, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %249, %206
  %211 = load i32, ptr %22, align 4, !tbaa !5
  %212 = load i32, ptr @c, align 16, !tbaa !5
  %213 = icmp slt i32 %211, %212
  br i1 %213, label %219, label %214

214:                                              ; preds = %210
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %252

215:                                              ; preds = %191
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %6, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %413

219:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %220 = load i32, ptr %22, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  store i32 %223, ptr %23, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %233, %219
  %225 = load i32, ptr %23, align 4, !tbaa !5
  %226 = load i32, ptr %20, align 4, !tbaa !5
  %227 = icmp slt i32 %225, %226
  br i1 %227, label %229, label %228

228:                                              ; preds = %224
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %237

229:                                              ; preds = %224
  %230 = load i32, ptr %23, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %231
  store i8 1, ptr %232, align 1, !tbaa !11
  br label %233

233:                                              ; preds = %229
  %234 = load i32, ptr @c, align 16, !tbaa !5
  %235 = load i32, ptr %23, align 4, !tbaa !5
  %236 = add nsw i32 %235, %234
  store i32 %236, ptr %23, align 4, !tbaa !5
  br label %224, !llvm.loop !19

237:                                              ; preds = %228
  %238 = load i32, ptr %21, align 4, !tbaa !5
  %239 = load i32, ptr @c, align 16, !tbaa !5
  %240 = srem i32 %238, %239
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = icmp eq i32 %243, 1061109567
  br i1 %244, label %245, label %248

245:                                              ; preds = %237
  %246 = load i32, ptr %21, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %21, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %245, %237
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %22, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %22, align 4, !tbaa !5
  br label %210, !llvm.loop !20

252:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %253 = load i32, ptr %20, align 4, !tbaa !5
  %254 = sub nsw i32 %253, 1
  store i32 %254, ptr %24, align 4, !tbaa !5
  br label %255

255:                                              ; preds = %274, %252
  %256 = load i32, ptr %24, align 4, !tbaa !5
  %257 = icmp sge i32 %256, 0
  br i1 %257, label %259, label %258

258:                                              ; preds = %255
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %277

259:                                              ; preds = %255
  %260 = load i32, ptr %24, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %261
  %263 = load i8, ptr %262, align 1, !tbaa !11, !range !13, !noundef !14
  %264 = trunc i8 %263 to i1
  br i1 %264, label %265, label %267

265:                                              ; preds = %259
  %266 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %266, ptr %21, align 4, !tbaa !5
  br label %267

267:                                              ; preds = %265, %259
  %268 = load i32, ptr %21, align 4, !tbaa !5
  %269 = load i32, ptr %24, align 4, !tbaa !5
  %270 = sub nsw i32 %268, %269
  %271 = load i32, ptr %24, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %272
  store i32 %270, ptr %273, align 4, !tbaa !5
  br label %274

274:                                              ; preds = %267
  %275 = load i32, ptr %24, align 4, !tbaa !5
  %276 = add nsw i32 %275, -1
  store i32 %276, ptr %24, align 4, !tbaa !5
  br label %255, !llvm.loop !21

277:                                              ; preds = %258
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %278 = load i32, ptr @p, align 4, !tbaa !5
  %279 = sub nsw i32 100, %278
  %280 = load i32, ptr @n, align 4, !tbaa !5
  %281 = call noundef i32 @_Z7mod_powii(i32 noundef %279, i32 noundef %280)
  store i32 %281, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %282 = load i32, ptr @p, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = load i32, ptr @p, align 4, !tbaa !5
  %285 = sub nsw i32 100, %284
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = mul nsw i64 %283, %289
  %291 = srem i64 %290, 1000000007
  %292 = trunc i64 %291 to i32
  store i32 %292, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %293

293:                                              ; preds = %359, %277
  %294 = load i32, ptr %27, align 4, !tbaa !5
  %295 = load i32, ptr %20, align 4, !tbaa !5
  %296 = icmp slt i32 %294, %295
  br i1 %296, label %297, label %301

297:                                              ; preds = %293
  %298 = load i32, ptr %27, align 4, !tbaa !5
  %299 = load i32, ptr @n, align 4, !tbaa !5
  %300 = icmp sle i32 %298, %299
  br label %301

301:                                              ; preds = %297, %293
  %302 = phi i1 [ false, %293 ], [ %300, %297 ]
  br i1 %302, label %304, label %303

303:                                              ; preds = %301
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %362

304:                                              ; preds = %301
  %305 = load i32, ptr %25, align 4, !tbaa !5
  %306 = load i32, ptr %27, align 4, !tbaa !5
  %307 = load i32, ptr @c, align 16, !tbaa !5
  %308 = srem i32 %306, %307
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [10001 x i32], ptr @coeff, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !5
  %312 = sub nsw i32 %311, %305
  store i32 %312, ptr %310, align 4, !tbaa !5
  %313 = icmp slt i32 %312, 0
  br i1 %313, label %314, label %323

314:                                              ; preds = %304
  %315 = load i32, ptr %27, align 4, !tbaa !5
  %316 = load i32, ptr @c, align 16, !tbaa !5
  %317 = srem i32 %315, %316
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [10001 x i32], ptr @coeff, i64 0, i64 %318
  %320 = load i32, ptr %319, align 4, !tbaa !5
  %321 = add nsw i32 %320, 1000000007
  store i32 %321, ptr %319, align 4, !tbaa !5
  %322 = icmp ne i32 %321, 0
  br label %323

323:                                              ; preds = %314, %304
  %324 = phi i1 [ false, %304 ], [ %322, %314 ]
  %325 = load i32, ptr %19, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = load i32, ptr %27, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %328
  %330 = load i32, ptr %329, align 4, !tbaa !5
  %331 = sext i32 %330 to i64
  %332 = load i32, ptr %25, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = mul nsw i64 %331, %333
  %335 = add nsw i64 %326, %334
  %336 = srem i64 %335, 1000000007
  %337 = trunc i64 %336 to i32
  store i32 %337, ptr %19, align 4, !tbaa !5
  %338 = load i32, ptr %25, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = load i32, ptr @n, align 4, !tbaa !5
  %341 = load i32, ptr %27, align 4, !tbaa !5
  %342 = sub nsw i32 %340, %341
  %343 = sext i32 %342 to i64
  %344 = mul nsw i64 %339, %343
  %345 = srem i64 %344, 1000000007
  %346 = load i32, ptr %27, align 4, !tbaa !5
  %347 = add nsw i32 %346, 1
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %348
  %350 = load i32, ptr %349, align 4, !tbaa !5
  %351 = sext i32 %350 to i64
  %352 = mul nsw i64 %345, %351
  %353 = srem i64 %352, 1000000007
  %354 = load i32, ptr %26, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = mul nsw i64 %353, %355
  %357 = srem i64 %356, 1000000007
  %358 = trunc i64 %357 to i32
  store i32 %358, ptr %25, align 4, !tbaa !5
  br label %359

359:                                              ; preds = %323
  %360 = load i32, ptr %27, align 4, !tbaa !5
  %361 = add nsw i32 %360, 1
  store i32 %361, ptr %27, align 4, !tbaa !5
  br label %293, !llvm.loop !22

362:                                              ; preds = %303
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %363 = load i32, ptr @c, align 16, !tbaa !5
  %364 = sub nsw i32 %363, 1
  store i32 %364, ptr %28, align 4, !tbaa !5
  br label %365

365:                                              ; preds = %406, %362
  %366 = load i32, ptr %28, align 4, !tbaa !5
  %367 = icmp sge i32 %366, 0
  br i1 %367, label %369, label %368

368:                                              ; preds = %365
  store i32 22, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %409

369:                                              ; preds = %365
  %370 = load i32, ptr %28, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %371
  %373 = load i32, ptr %372, align 4, !tbaa !5
  %374 = icmp ne i32 %373, 1061109567
  br i1 %374, label %375, label %377

375:                                              ; preds = %369
  %376 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %376, ptr %21, align 4, !tbaa !5
  br label %377

377:                                              ; preds = %375, %369
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %378 = load i32, ptr %21, align 4, !tbaa !5
  %379 = load i32, ptr %28, align 4, !tbaa !5
  %380 = icmp slt i32 %378, %379
  br i1 %380, label %381, label %387

381:                                              ; preds = %377
  %382 = load i32, ptr %21, align 4, !tbaa !5
  %383 = load i32, ptr %28, align 4, !tbaa !5
  %384 = sub nsw i32 %382, %383
  %385 = load i32, ptr @c, align 16, !tbaa !5
  %386 = add nsw i32 %384, %385
  br label %391

387:                                              ; preds = %377
  %388 = load i32, ptr %21, align 4, !tbaa !5
  %389 = load i32, ptr %28, align 4, !tbaa !5
  %390 = sub nsw i32 %388, %389
  br label %391

391:                                              ; preds = %387, %381
  %392 = phi i32 [ %386, %381 ], [ %390, %387 ]
  store i32 %392, ptr %29, align 4, !tbaa !5
  %393 = load i32, ptr %19, align 4, !tbaa !5
  %394 = sext i32 %393 to i64
  %395 = load i32, ptr %29, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = load i32, ptr %28, align 4, !tbaa !5
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds [10001 x i32], ptr @coeff, i64 0, i64 %398
  %400 = load i32, ptr %399, align 4, !tbaa !5
  %401 = sext i32 %400 to i64
  %402 = mul nsw i64 %396, %401
  %403 = add nsw i64 %394, %402
  %404 = srem i64 %403, 1000000007
  %405 = trunc i64 %404 to i32
  store i32 %405, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %406

406:                                              ; preds = %391
  %407 = load i32, ptr %28, align 4, !tbaa !5
  %408 = add nsw i32 %407, -1
  store i32 %408, ptr %28, align 4, !tbaa !5
  br label %365, !llvm.loop !23

409:                                              ; preds = %368
  %410 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %410, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %411

411:                                              ; preds = %409, %182
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #5
  %412 = load i32, ptr %1, align 4
  ret i32 %412

413:                                              ; preds = %215, %174, %123, %61, %57
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #5
  br label %414

414:                                              ; preds = %413
  %415 = load ptr, ptr %6, align 8
  %416 = load i32, ptr %7, align 4
  %417 = insertvalue { ptr, i32 } poison, ptr %415, 0
  %418 = insertvalue { ptr, i32 } %417, i32 %416, 1
  resume { ptr, i32 } %418

419:                                              ; preds = %120
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; 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)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 align 2

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

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

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


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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@inv = external dso_local local_unnamed_addr global [10001 x i32], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local local_unnamed_addr global [101 x i32], align 16
@coeff = external dso_local local_unnamed_addr global [2 x [10001 x i32]], align 16
@_ZZ6solve2vE3low = external hidden local_unnamed_addr global [101 x i32], align 16
@_ZZ6solve2vE3vis = external hidden local_unnamed_addr global [10001 x i8], align 16
@_ZZ6solve2vE3rem = external hidden local_unnamed_addr global [10001 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1000000006, 1000000007) i32 @_Z6solve2v() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::priority_queue", align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %10 = load i32, ptr @c, align 16, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = shl nsw i64 %11, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ6solve2vE3low, i8 63, i64 %12, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ6solve2vE3vis, i8 0, i64 %11, i1 false)
  store i32 0, ptr @_ZZ6solve2vE3low, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  %13 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %14 unwind label %25

14:                                               ; preds = %0
  store i64 %13, ptr %2, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
          to label %15 unwind label %25

15:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %16 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %16, label %._crit_edge, label %.lr.ph92

.lr.ph92:                                         ; preds = %15, %.loopexit90
  %17 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %18 = getelementptr inbounds i8, ptr %17, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !9
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
          to label %20 unwind label %27

20:                                               ; preds = %.lr.ph92
  %21 = sext i32 %19 to i64
  %22 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !11, !range !13, !noundef !14
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %.loopexit90, label %29, !llvm.loop !15

25:                                               ; preds = %14, %0
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %247

27:                                               ; preds = %.lr.ph92
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %247

29:                                               ; preds = %20
  store i8 1, ptr %22, align 1, !tbaa !11
  %30 = load i32, ptr @m, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 1
  br i1 %31, label %.lr.ph, label %.loopexit90

.lr.ph:                                           ; preds = %29
  %32 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %21
  br label %33

33:                                               ; preds = %.lr.ph, %53
  %34 = phi i32 [ %30, %.lr.ph ], [ %54, %53 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %53 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %35 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, %19
  %38 = load i32, ptr @c, align 16, !tbaa !5
  %39 = srem i32 %37, %38
  store i32 %39, ptr %5, align 4, !tbaa !5
  %40 = load i32, ptr %32, align 4, !tbaa !5
  %41 = add nsw i32 %40, %36
  %42 = sext i32 %39 to i64
  %43 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp slt i32 %41, %44
  br i1 %45, label %46, label %53

46:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 %41, ptr %43, align 4, !tbaa !5
  %47 = sub nsw i32 0, %41
  store i32 %47, ptr %7, align 4, !tbaa !5
  %48 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %49 unwind label %51

49:                                               ; preds = %46
  store i64 %48, ptr %6, align 8
  invoke void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %50 unwind label %51

50:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %53

51:                                               ; preds = %49, %46
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %247

53:                                               ; preds = %50, %33
  %54 = phi i32 [ %.pre, %50 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next, %55
  br i1 %56, label %33, label %.loopexit90, !llvm.loop !17

.loopexit90:                                      ; preds = %53, %29, %20
  %57 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %57, label %._crit_edge, label %.lr.ph92

._crit_edge:                                      ; preds = %.loopexit90, %15
  %58 = load i32, ptr @p, align 4, !tbaa !5
  %59 = icmp eq i32 %58, 100
  br i1 %59, label %60, label %97

60:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %61 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %61, ptr %8, align 4, !tbaa !5
  %62 = load i32, ptr @c, align 16, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph120, label %._crit_edge121

._crit_edge121.loopexit:                          ; preds = %92
  %.pre146 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge121

._crit_edge121:                                   ; preds = %._crit_edge121.loopexit, %60
  %64 = phi i32 [ %.pre146, %._crit_edge121.loopexit ], [ %61, %60 ]
  %65 = phi i32 [ %93, %._crit_edge121.loopexit ], [ %61, %60 ]
  %66 = sext i32 %65 to i64
  %67 = call noundef i32 @_Z7mod_powii(i32 noundef 100, i32 noundef %64)
  %68 = sext i32 %67 to i64
  %69 = mul nsw i64 %68, %66
  %70 = srem i64 %69, 1000000007
  %71 = trunc nsw i64 %70 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  br label %.loopexit

.lr.ph120:                                        ; preds = %60, %92
  %72 = phi i32 [ %93, %92 ], [ %61, %60 ]
  %73 = phi i32 [ %94, %92 ], [ %62, %60 ]
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %92 ], [ 0, %60 ]
  %74 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %indvars.iv141
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 1061109567
  br i1 %76, label %77, label %92

77:                                               ; preds = %.lr.ph120
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = icmp slt i32 %75, %78
  br i1 %79, label %80, label %86

80:                                               ; preds = %77
  %81 = xor i32 %75, -1
  %82 = add i32 %78, %81
  %83 = sdiv i32 %82, %73
  %84 = add nsw i32 %83, 1
  %85 = mul nsw i32 %84, %73
  br label %86

86:                                               ; preds = %77, %80
  %87 = phi i32 [ %85, %80 ], [ 0, %77 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %88 = sub i32 %75, %78
  %89 = add i32 %88, %87
  store i32 %89, ptr %9, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  %.pre145 = load i32, ptr @c, align 16, !tbaa !5
  br label %92

92:                                               ; preds = %.lr.ph120, %86
  %93 = phi i32 [ %72, %.lr.ph120 ], [ %91, %86 ]
  %94 = phi i32 [ %73, %.lr.ph120 ], [ %.pre145, %86 ]
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next142, %95
  br i1 %96, label %.lr.ph120, label %._crit_edge121.loopexit, !llvm.loop !18

97:                                               ; preds = %._crit_edge
  %98 = load i32, ptr @m, align 4, !tbaa !5
  %99 = add nsw i32 %98, -2
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %98, -1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = mul i32 %106, %102
  %108 = add i32 %107, -1
  %109 = load i32, ptr @n, align 4, !tbaa !5
  invoke void @_Z5solveii(i32 noundef 0, i32 noundef %109)
          to label %110 unwind label %125

110:                                              ; preds = %97
  %111 = sext i32 %107 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ6solve2vE3vis, i8 0, i64 %111, i1 false)
  %112 = load i32, ptr @c, align 16, !tbaa !5
  %113 = icmp sgt i32 %112, 0
  br i1 %113, label %.lr.ph100.preheader, label %.preheader

.lr.ph100.preheader:                              ; preds = %110
  %114 = zext nneg i32 %112 to i64
  %wide.trip.count = zext nneg i32 %112 to i64
  %ident.check.not = icmp eq i32 %112, 1
  br label %.lr.ph100

.preheader:                                       ; preds = %._crit_edge96, %110
  %.073.lcssa = phi i32 [ %108, %110 ], [ %spec.select, %._crit_edge96 ]
  %115 = icmp sgt i32 %107, 0
  br i1 %115, label %.lr.ph103.preheader, label %._crit_edge104

.lr.ph103.preheader:                              ; preds = %.preheader
  %116 = zext i32 %108 to i64
  %117 = and i32 %107, 3
  %xtraiter = zext nneg i32 %117 to i64
  %lcmp.mod.not = icmp eq i32 %117, 0
  br i1 %lcmp.mod.not, label %.lr.ph103.prol.loopexit, label %.lr.ph103.prol

.lr.ph103.prol:                                   ; preds = %.lr.ph103.preheader, %.lr.ph103.prol
  %indvars.iv130.prol = phi i64 [ %indvars.iv.next131.prol, %.lr.ph103.prol ], [ %116, %.lr.ph103.preheader ]
  %.2101.prol = phi i32 [ %spec.select87.prol, %.lr.ph103.prol ], [ %.073.lcssa, %.lr.ph103.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph103.prol ], [ 0, %.lr.ph103.preheader ]
  %118 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %indvars.iv130.prol
  %119 = load i8, ptr %118, align 1, !tbaa !11, !range !13, !noundef !14
  %120 = trunc nuw i8 %119 to i1
  %121 = trunc nuw nsw i64 %indvars.iv130.prol to i32
  %spec.select87.prol = select i1 %120, i32 %121, i32 %.2101.prol
  %122 = sub nsw i32 %spec.select87.prol, %121
  %123 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %indvars.iv130.prol
  store i32 %122, ptr %123, align 4, !tbaa !5
  %indvars.iv.next131.prol = add nsw i64 %indvars.iv130.prol, -1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph103.prol.loopexit, label %.lr.ph103.prol, !llvm.loop !19

.lr.ph103.prol.loopexit:                          ; preds = %.lr.ph103.prol, %.lr.ph103.preheader
  %indvars.iv130.unr = phi i64 [ %116, %.lr.ph103.preheader ], [ %indvars.iv.next131.prol, %.lr.ph103.prol ]
  %.2101.unr = phi i32 [ %.073.lcssa, %.lr.ph103.preheader ], [ %spec.select87.prol, %.lr.ph103.prol ]
  %124 = icmp ult i32 %107, 4
  br i1 %124, label %._crit_edge104, label %.lr.ph103

125:                                              ; preds = %97
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %247

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %._crit_edge96
  %indvars.iv127 = phi i64 [ 0, %.lr.ph100.preheader ], [ %indvars.iv.next128, %._crit_edge96 ]
  %.07397 = phi i32 [ %108, %.lr.ph100.preheader ], [ %spec.select, %._crit_edge96 ]
  %127 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %indvars.iv127
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = icmp slt i32 %128, %107
  br i1 %129, label %iter.check, label %._crit_edge96

iter.check:                                       ; preds = %.lr.ph100
  %130 = sext i32 %128 to i64
  %131 = add nsw i64 %114, %130
  %smax = call i64 @llvm.smax.i64(i64 %131, i64 %111)
  %132 = icmp slt i64 %131, %111
  %umin152.neg = sext i1 %132 to i64
  %133 = select i1 %132, i64 2, i64 1
  %134 = add i64 %smax, %umin152.neg
  %135 = sub i64 %134, %131
  %136 = udiv i64 %135, %114
  %137 = add i64 %133, %136
  %min.iters.check = icmp ugt i64 %137, 7
  %or.cond = and i1 %min.iters.check, %ident.check.not
  br i1 %or.cond, label %vector.main.loop.iter.check, label %.lr.ph95.preheader

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check153 = icmp ult i64 %137, 32
  br i1 %min.iters.check153, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %137, -32
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %138 = mul nuw i64 %index, %114
  %offset.idx = add i64 %138, %130
  %139 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %offset.idx
  %140 = getelementptr inbounds i8, ptr %139, i64 16
  store <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %139, align 1, !tbaa !11
  store <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %140, align 1, !tbaa !11
  %index.next = add nuw i64 %index, 32
  %141 = icmp eq i64 %index.next, %n.vec
  br i1 %141, label %middle.block, label %vector.body, !llvm.loop !21

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %137, %n.vec
  br i1 %cmp.n, label %._crit_edge96, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %142 = mul nuw i64 %n.vec, %114
  %ind.end156 = add i64 %142, %130
  %n.vec.remaining = and i64 %137, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph95.preheader, label %vec.epilog.ph

.lr.ph95.preheader:                               ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv124.ph = phi i64 [ %130, %iter.check ], [ %ind.end156, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  br label %.lr.ph95

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec155 = and i64 %137, -8
  %143 = mul nuw i64 %n.vec155, %114
  %ind.end = add i64 %143, %130
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index157 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next159, %vec.epilog.vector.body ]
  %144 = mul nuw i64 %index157, %114
  %offset.idx158 = add i64 %144, %130
  %145 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %offset.idx158
  store <8 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %145, align 1, !tbaa !11
  %index.next159 = add nuw i64 %index157, 8
  %146 = icmp eq i64 %index.next159, %n.vec155
  br i1 %146, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !24

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n160 = icmp eq i64 %137, %n.vec155
  br i1 %cmp.n160, label %._crit_edge96, label %.lr.ph95.preheader

._crit_edge96:                                    ; preds = %.lr.ph95, %middle.block, %vec.epilog.middle.block, %.lr.ph100
  %147 = srem i32 %.07397, %112
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp eq i32 %150, 1061109567
  %152 = zext i1 %151 to i32
  %spec.select = add nsw i32 %.07397, %152
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph100, !llvm.loop !25

.lr.ph95:                                         ; preds = %.lr.ph95.preheader, %.lr.ph95
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %.lr.ph95 ], [ %indvars.iv124.ph, %.lr.ph95.preheader ]
  %153 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %indvars.iv124
  store i8 1, ptr %153, align 1, !tbaa !11
  %indvars.iv.next125 = add nsw i64 %indvars.iv124, %114
  %154 = icmp slt i64 %indvars.iv.next125, %111
  br i1 %154, label %.lr.ph95, label %._crit_edge96, !llvm.loop !26

._crit_edge104:                                   ; preds = %.lr.ph103.prol.loopexit, %.lr.ph103, %.preheader
  %155 = load i32, ptr @p, align 4, !tbaa !5
  %156 = sub nsw i32 100, %155
  %157 = load i32, ptr @n, align 4, !tbaa !5
  %158 = call noundef i32 @_Z7mod_powii(i32 noundef %156, i32 noundef %157)
  %159 = load i32, ptr @p, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = sub nsw i32 100, %159
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = mul nsw i64 %165, %160
  %167 = srem i64 %166, 1000000007
  %168 = load i32, ptr @n, align 4
  %169 = freeze i32 %168
  %170 = icmp sgt i32 %169, -1
  %171 = and i1 %115, %170
  %.pre144 = load i32, ptr @c, align 16
  br i1 %171, label %.lr.ph109, label %._crit_edge110

.lr.ph109:                                        ; preds = %._crit_edge104
  %172 = zext nneg i32 %169 to i64
  %umin = call i32 @llvm.umin.i32(i32 %169, i32 %108)
  %173 = add nuw nsw i32 %umin, 1
  %wide.trip.count136 = zext nneg i32 %173 to i64
  br label %201

.lr.ph103:                                        ; preds = %.lr.ph103.prol.loopexit, %.lr.ph103
  %indvars.iv130 = phi i64 [ %indvars.iv.next131.3, %.lr.ph103 ], [ %indvars.iv130.unr, %.lr.ph103.prol.loopexit ]
  %.2101 = phi i32 [ %spec.select87.3, %.lr.ph103 ], [ %.2101.unr, %.lr.ph103.prol.loopexit ]
  %174 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %indvars.iv130
  %175 = load i8, ptr %174, align 1, !tbaa !11, !range !13, !noundef !14
  %176 = trunc nuw i8 %175 to i1
  %177 = trunc nuw nsw i64 %indvars.iv130 to i32
  %spec.select87 = select i1 %176, i32 %177, i32 %.2101
  %178 = sub nsw i32 %spec.select87, %177
  %179 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %indvars.iv130
  store i32 %178, ptr %179, align 4, !tbaa !5
  %indvars.iv.next131 = add nsw i64 %indvars.iv130, -1
  %180 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %indvars.iv.next131
  %181 = load i8, ptr %180, align 1, !tbaa !11, !range !13, !noundef !14
  %182 = trunc nuw i8 %181 to i1
  %183 = trunc nuw nsw i64 %indvars.iv.next131 to i32
  %spec.select87.1 = select i1 %182, i32 %183, i32 %spec.select87
  %184 = sub nsw i32 %spec.select87.1, %183
  %185 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %indvars.iv.next131
  store i32 %184, ptr %185, align 4, !tbaa !5
  %indvars.iv.next131.1 = add nsw i64 %indvars.iv130, -2
  %186 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %indvars.iv.next131.1
  %187 = load i8, ptr %186, align 1, !tbaa !11, !range !13, !noundef !14
  %188 = trunc nuw i8 %187 to i1
  %189 = trunc nuw nsw i64 %indvars.iv.next131.1 to i32
  %spec.select87.2 = select i1 %188, i32 %189, i32 %spec.select87.1
  %190 = sub nsw i32 %spec.select87.2, %189
  %191 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %indvars.iv.next131.1
  store i32 %190, ptr %191, align 4, !tbaa !5
  %indvars.iv.next131.2 = add nsw i64 %indvars.iv130, -3
  %192 = getelementptr inbounds [10001 x i8], ptr @_ZZ6solve2vE3vis, i64 0, i64 %indvars.iv.next131.2
  %193 = load i8, ptr %192, align 1, !tbaa !11, !range !13, !noundef !14
  %194 = trunc nuw i8 %193 to i1
  %195 = trunc nuw nsw i64 %indvars.iv.next131.2 to i32
  %spec.select87.3 = select i1 %194, i32 %195, i32 %spec.select87.2
  %196 = sub nsw i32 %spec.select87.3, %195
  %197 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %indvars.iv.next131.2
  store i32 %196, ptr %197, align 4, !tbaa !5
  %indvars.iv.next131.3 = add nsw i64 %indvars.iv130, -4
  %.not149.3 = icmp eq i64 %indvars.iv.next131.2, 0
  br i1 %.not149.3, label %._crit_edge104, label %.lr.ph103, !llvm.loop !27

._crit_edge110.loopexit:                          ; preds = %201
  %198 = trunc nsw i64 %216 to i32
  br label %._crit_edge110

._crit_edge110:                                   ; preds = %._crit_edge110.loopexit, %._crit_edge104
  %.077.lcssa = phi i32 [ 0, %._crit_edge104 ], [ %198, %._crit_edge110.loopexit ]
  %199 = icmp sgt i32 %.pre144, 0
  br i1 %199, label %.lr.ph116.preheader, label %.loopexit

.lr.ph116.preheader:                              ; preds = %._crit_edge110
  %200 = zext nneg i32 %.pre144 to i64
  br label %.lr.ph116

201:                                              ; preds = %.lr.ph109, %201
  %indvars.iv133 = phi i64 [ 0, %.lr.ph109 ], [ %indvars.iv.next134, %201 ]
  %.069106 = phi i32 [ %158, %.lr.ph109 ], [ %227, %201 ]
  %.077105 = phi i64 [ 0, %.lr.ph109 ], [ %216, %201 ]
  %202 = trunc nuw nsw i64 %indvars.iv133 to i32
  %203 = srem i32 %202, %.pre144
  %204 = zext nneg i32 %203 to i64
  %205 = getelementptr inbounds [10001 x i32], ptr @coeff, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = sub nsw i32 %206, %.069106
  %208 = icmp slt i32 %207, 0
  %209 = add nsw i32 %207, 1000000007
  %spec.select89 = select i1 %208, i32 %209, i32 %207
  store i32 %spec.select89, ptr %205, align 4, !tbaa !5
  %210 = getelementptr inbounds [10001 x i32], ptr @_ZZ6solve2vE3rem, i64 0, i64 %indvars.iv133
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = sext i32 %.069106 to i64
  %214 = mul nsw i64 %212, %213
  %215 = add nsw i64 %214, %.077105
  %216 = srem i64 %215, 1000000007
  %217 = sub nsw i64 %172, %indvars.iv133
  %218 = mul nsw i64 %217, %213
  %219 = srem i64 %218, 1000000007
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %220 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %indvars.iv.next134
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = mul nsw i64 %219, %222
  %224 = srem i64 %223, 1000000007
  %225 = mul nsw i64 %224, %167
  %226 = srem i64 %225, 1000000007
  %227 = trunc nsw i64 %226 to i32
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
  br i1 %exitcond137.not, label %._crit_edge110.loopexit, label %201, !llvm.loop !28

.lr.ph116:                                        ; preds = %.lr.ph116.preheader, %.lr.ph116
  %indvars.iv138 = phi i64 [ %200, %.lr.ph116.preheader ], [ %indvars.iv.next139, %.lr.ph116 ]
  %.4113 = phi i32 [ 0, %.lr.ph116.preheader ], [ %spec.select88, %.lr.ph116 ]
  %.178112 = phi i32 [ %.077.lcssa, %.lr.ph116.preheader ], [ %245, %.lr.ph116 ]
  %indvars.iv.next139 = add nsw i64 %indvars.iv138, -1
  %228 = getelementptr inbounds [101 x i32], ptr @_ZZ6solve2vE3low, i64 0, i64 %indvars.iv.next139
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %.not = icmp eq i32 %229, 1061109567
  %230 = trunc nuw nsw i64 %indvars.iv.next139 to i32
  %spec.select88 = select i1 %.not, i32 %.4113, i32 %230
  %231 = sext i32 %spec.select88 to i64
  %232 = icmp sgt i64 %indvars.iv.next139, %231
  %233 = trunc nuw nsw i64 %indvars.iv138 to i32
  %reass.sub = sub i32 %spec.select88, %233
  %234 = add i32 %reass.sub, 1
  %235 = select i1 %232, i32 %.pre144, i32 0
  %236 = add nsw i32 %234, %235
  %237 = sext i32 %.178112 to i64
  %238 = sext i32 %236 to i64
  %239 = getelementptr inbounds [10001 x i32], ptr @coeff, i64 0, i64 %indvars.iv.next139
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = mul nsw i64 %238, %241
  %243 = add nsw i64 %242, %237
  %244 = srem i64 %243, 1000000007
  %245 = trunc nsw i64 %244 to i32
  %246 = icmp ugt i64 %indvars.iv138, 1
  br i1 %246, label %.lr.ph116, label %.loopexit, !llvm.loop !29

.loopexit:                                        ; preds = %.lr.ph116, %._crit_edge110, %._crit_edge121
  %.0 = phi i32 [ %71, %._crit_edge121 ], [ %.077.lcssa, %._crit_edge110 ], [ %245, %.lr.ph116 ]
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  ret i32 %.0

247:                                              ; preds = %27, %51, %125, %25
  %.pn.pn = phi { ptr, i32 } [ %126, %125 ], [ %26, %25 ], [ %52, %51 ], [ %28, %27 ]
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; 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 #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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

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

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


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