; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100705B3)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [1500001 x i32], align 16
@tot = external dso_local global i32, align 4
@prime = external dso_local global [1500001 x i32], align 16
@fact = external dso_local global [1500001 x i32], align 16
@f = external dso_local global [2 x [21 x [21 x i64]]], align 16
@ans = external dso_local global i64, align 8
@e = external dso_local global [1500001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %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
  store i32 0, ptr %1, align 4
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = srem i32 1425, %31
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr getelementptr inbounds ([1500001 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %56, %0
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 1394, %45
  %47 = add nsw i64 %46, 2015
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = srem i64 %47, %49
  %51 = add nsw i64 %50, 1
  %52 = trunc i64 %51 to i32
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %39
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !9

59:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %127, %59
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr @m, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %60
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %80, label %71

71:                                               ; preds = %65
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = load i32, ptr @tot, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @tot, align 4, !tbaa !5
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %75
  store i32 %72, ptr %76, align 4, !tbaa !5
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %78
  store i32 %72, ptr %79, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %71, %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %122, %80
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = load i32, ptr @tot, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %97

85:                                               ; preds = %81
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = mul nsw i64 %87, %92
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = icmp sle i64 %93, %95
  br label %97

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

99:                                               ; preds = %97
  store i32 8, ptr %4, align 4
  br label %125

100:                                              ; preds = %97
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = mul nsw i32 %105, %109
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %111
  store i32 %104, ptr %112, align 4, !tbaa !5
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = srem i32 %113, %117
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %100
  store i32 8, ptr %4, align 4
  br label %125

121:                                              ; preds = %100
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %5, align 4, !tbaa !5
  br label %81, !llvm.loop !11

125:                                              ; preds = %120, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %3, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %3, align 4, !tbaa !5
  br label %60, !llvm.loop !12

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

131:                                              ; preds = %170, %130
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = icmp sle i32 %132, %133
  br i1 %134, label %136, label %135

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

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %7, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %164, %136
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = icmp sgt i32 %142, 1
  br i1 %143, label %145, label %144

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

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  store i32 %149, ptr %9, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %158, %145
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !5
  %156 = icmp eq i32 %154, %155
  br i1 %156, label %157, label %164

157:                                              ; preds = %150
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = sdiv i32 %160, %159
  store i32 %161, ptr %7, align 4, !tbaa !5
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %8, align 4, !tbaa !5
  br label %150, !llvm.loop !13

164:                                              ; preds = %150
  %165 = load i32, ptr %9, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1500001 x %"class.std::vector"], ptr @e, i64 0, i64 %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %168 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i64 %168, ptr %10, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %167, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %141, !llvm.loop !14

169:                                              ; preds = %144
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %6, align 4, !tbaa !5
  br label %131, !llvm.loop !15

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

174:                                              ; preds = %444, %173
  %175 = load i32, ptr %11, align 4, !tbaa !5
  %176 = load i32, ptr @m, align 4, !tbaa !5
  %177 = icmp sle i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %447

179:                                              ; preds = %174
  %180 = load i32, ptr %11, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [1500001 x %"class.std::vector"], ptr @e, i64 0, i64 %181
  %183 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %182) #7
  %184 = icmp ne i64 %183, 0
  br i1 %184, label %186, label %185

185:                                              ; preds = %179
  br label %444

186:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !5
  %187 = load i32, ptr %15, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %188
  %190 = getelementptr inbounds [21 x [21 x i64]], ptr %189, i64 0, i64 0
  %191 = getelementptr inbounds [21 x i64], ptr %190, i64 0, i64 0
  store i64 0, ptr %191, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [1500001 x %"class.std::vector"], ptr @e, i64 0, i64 %193
  %195 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %194) #7
  %196 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %195, ptr %196, align 8
  br label %197

197:                                              ; preds = %394, %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %198 = load i32, ptr %11, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [1500001 x %"class.std::vector"], ptr @e, i64 0, i64 %199
  %201 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %200) #7
  %202 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %201, ptr %202, align 8
  %203 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br i1 %203, label %205, label %204

204:                                              ; preds = %197
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %396

205:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %206 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %207 = getelementptr inbounds %"struct.std::pair", ptr %206, i32 0, i32 0
  %208 = load i32, ptr %207, align 4, !tbaa !18
  store i32 %208, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %209 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %210 = getelementptr inbounds %"struct.std::pair", ptr %209, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !20
  store i32 %211, ptr %20, align 4, !tbaa !5
  %212 = load i32, ptr %12, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  %214 = load i32, ptr %19, align 4, !tbaa !5
  %215 = icmp slt i32 %213, %214
  br i1 %215, label %216, label %256

216:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %252, %216
  %218 = load i32, ptr %21, align 4, !tbaa !5
  %219 = load i32, ptr %13, align 4, !tbaa !5
  %220 = icmp sle i32 %218, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %217
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %255

222:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %248, %222
  %224 = load i32, ptr %22, align 4, !tbaa !5
  %225 = load i32, ptr %14, align 4, !tbaa !5
  %226 = icmp sle i32 %224, %225
  br i1 %226, label %228, label %227

227:                                              ; preds = %223
  store i32 28, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %251

228:                                              ; preds = %223
  %229 = load i32, ptr %15, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %230
  %232 = getelementptr inbounds [21 x [21 x i64]], ptr %231, i64 0, i64 0
  %233 = getelementptr inbounds [21 x i64], ptr %232, i64 0, i64 0
  %234 = load i32, ptr %15, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %235
  %237 = load i32, ptr %21, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [21 x [21 x i64]], ptr %236, i64 0, i64 %238
  %240 = load i32, ptr %22, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [21 x i64], ptr %239, i64 0, i64 %241
  %243 = load i64, ptr %242, align 8, !tbaa !16
  %244 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = add nsw i64 %243, %246
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %233, i64 noundef %247)
  br label %248

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

251:                                              ; preds = %227
  br label %252

252:                                              ; preds = %251
  %253 = load i32, ptr %21, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %21, align 4, !tbaa !5
  br label %217, !llvm.loop !22

255:                                              ; preds = %221
  store i32 0, ptr %14, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %255, %205
  %257 = load i32, ptr %15, align 4, !tbaa !5
  %258 = xor i32 %257, 1
  store i32 %258, ptr %15, align 4, !tbaa !5
  %259 = load i32, ptr %16, align 4, !tbaa !5
  %260 = xor i32 %259, 1
  store i32 %260, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %278, %256
  %262 = load i32, ptr %23, align 4, !tbaa !5
  %263 = load i32, ptr %14, align 4, !tbaa !5
  %264 = icmp sle i32 %262, %263
  br i1 %264, label %266, label %265

265:                                              ; preds = %261
  store i32 31, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %281

266:                                              ; preds = %261
  %267 = load i32, ptr %15, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %268
  %270 = load i32, ptr %23, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [21 x [21 x i64]], ptr %269, i64 0, i64 %271
  %273 = getelementptr inbounds [21 x i64], ptr %272, i64 0, i64 0
  %274 = load i32, ptr %20, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  %276 = sext i32 %275 to i64
  %277 = mul i64 %276, 8
  call void @llvm.memset.p0.i64(ptr align 8 %273, i8 63, i64 %277, i1 false)
  br label %278

278:                                              ; preds = %266
  %279 = load i32, ptr %23, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %23, align 4, !tbaa !5
  br label %261, !llvm.loop !23

281:                                              ; preds = %265
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %282

282:                                              ; preds = %339, %281
  %283 = load i32, ptr %24, align 4, !tbaa !5
  %284 = load i32, ptr %14, align 4, !tbaa !5
  %285 = icmp sle i32 %283, %284
  br i1 %285, label %287, label %286

286:                                              ; preds = %282
  store i32 34, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %342

287:                                              ; preds = %282
  %288 = load i32, ptr %16, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %289
  %291 = getelementptr inbounds [21 x [21 x i64]], ptr %290, i64 0, i64 0
  %292 = load i32, ptr %24, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [21 x i64], ptr %291, i64 0, i64 %293
  %295 = load i64, ptr %294, align 8, !tbaa !16
  %296 = icmp eq i64 %295, 4557430888798830399
  br i1 %296, label %297, label %298

297:                                              ; preds = %287
  br label %339

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

299:                                              ; preds = %335, %298
  %300 = load i32, ptr %25, align 4, !tbaa !5
  %301 = load i32, ptr %24, align 4, !tbaa !5
  %302 = icmp sle i32 %300, %301
  br i1 %302, label %303, label %307

303:                                              ; preds = %299
  %304 = load i32, ptr %25, align 4, !tbaa !5
  %305 = load i32, ptr %20, align 4, !tbaa !5
  %306 = icmp sle i32 %304, %305
  br label %307

307:                                              ; preds = %303, %299
  %308 = phi i1 [ false, %299 ], [ %306, %303 ]
  br i1 %308, label %310, label %309

309:                                              ; preds = %307
  store i32 37, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %338

310:                                              ; preds = %307
  %311 = load i32, ptr %15, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %312
  %314 = load i32, ptr %24, align 4, !tbaa !5
  %315 = load i32, ptr %25, align 4, !tbaa !5
  %316 = sub nsw i32 %314, %315
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [21 x [21 x i64]], ptr %313, i64 0, i64 %317
  %319 = load i32, ptr %20, align 4, !tbaa !5
  %320 = load i32, ptr %25, align 4, !tbaa !5
  %321 = sub nsw i32 %319, %320
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [21 x i64], ptr %318, i64 0, i64 %322
  %324 = load i32, ptr %16, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %325
  %327 = getelementptr inbounds [21 x [21 x i64]], ptr %326, i64 0, i64 0
  %328 = load i32, ptr %24, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [21 x i64], ptr %327, i64 0, i64 %329
  %331 = load i64, ptr %330, align 8, !tbaa !16
  %332 = load i32, ptr %25, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = add nsw i64 %331, %333
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %323, i64 noundef %334)
  br label %335

335:                                              ; preds = %310
  %336 = load i32, ptr %25, align 4, !tbaa !5
  %337 = add nsw i32 %336, 1
  store i32 %337, ptr %25, align 4, !tbaa !5
  br label %299, !llvm.loop !24

338:                                              ; preds = %309
  br label %339

339:                                              ; preds = %338, %297
  %340 = load i32, ptr %24, align 4, !tbaa !5
  %341 = add nsw i32 %340, 1
  store i32 %341, ptr %24, align 4, !tbaa !5
  br label %282, !llvm.loop !25

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

343:                                              ; preds = %387, %342
  %344 = load i32, ptr %26, align 4, !tbaa !5
  %345 = load i32, ptr %13, align 4, !tbaa !5
  %346 = icmp sle i32 %344, %345
  br i1 %346, label %348, label %347

347:                                              ; preds = %343
  store i32 40, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %390

348:                                              ; preds = %343
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %349

349:                                              ; preds = %383, %348
  %350 = load i32, ptr %27, align 4, !tbaa !5
  %351 = load i32, ptr %14, align 4, !tbaa !5
  %352 = icmp sle i32 %350, %351
  br i1 %352, label %353, label %357

353:                                              ; preds = %349
  %354 = load i32, ptr %27, align 4, !tbaa !5
  %355 = load i32, ptr %20, align 4, !tbaa !5
  %356 = icmp sle i32 %354, %355
  br label %357

357:                                              ; preds = %353, %349
  %358 = phi i1 [ false, %349 ], [ %356, %353 ]
  br i1 %358, label %360, label %359

359:                                              ; preds = %357
  store i32 43, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %386

360:                                              ; preds = %357
  %361 = load i32, ptr %15, align 4, !tbaa !5
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %362
  %364 = getelementptr inbounds [21 x [21 x i64]], ptr %363, i64 0, i64 0
  %365 = load i32, ptr %20, align 4, !tbaa !5
  %366 = load i32, ptr %27, align 4, !tbaa !5
  %367 = sub nsw i32 %365, %366
  %368 = sext i32 %367 to i64
  %369 = getelementptr inbounds [21 x i64], ptr %364, i64 0, i64 %368
  %370 = load i32, ptr %16, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %371
  %373 = load i32, ptr %26, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [21 x [21 x i64]], ptr %372, i64 0, i64 %374
  %376 = load i32, ptr %27, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [21 x i64], ptr %375, i64 0, i64 %377
  %379 = load i64, ptr %378, align 8, !tbaa !16
  %380 = load i32, ptr %27, align 4, !tbaa !5
  %381 = sext i32 %380 to i64
  %382 = add nsw i64 %379, %381
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %369, i64 noundef %382)
  br label %383

383:                                              ; preds = %360
  %384 = load i32, ptr %27, align 4, !tbaa !5
  %385 = add nsw i32 %384, 1
  store i32 %385, ptr %27, align 4, !tbaa !5
  br label %349, !llvm.loop !26

386:                                              ; preds = %359
  br label %387

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

390:                                              ; preds = %347
  %391 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %391, ptr %12, align 4, !tbaa !5
  %392 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %392, ptr %13, align 4, !tbaa !5
  %393 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %393, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %394

394:                                              ; preds = %390
  %395 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %197, !llvm.loop !28

396:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %397

397:                                              ; preds = %432, %396
  %398 = load i32, ptr %28, align 4, !tbaa !5
  %399 = load i32, ptr %13, align 4, !tbaa !5
  %400 = icmp sle i32 %398, %399
  br i1 %400, label %402, label %401

401:                                              ; preds = %397
  store i32 46, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %435

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

403:                                              ; preds = %428, %402
  %404 = load i32, ptr %29, align 4, !tbaa !5
  %405 = load i32, ptr %14, align 4, !tbaa !5
  %406 = icmp sle i32 %404, %405
  br i1 %406, label %408, label %407

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

408:                                              ; preds = %403
  %409 = load i32, ptr %15, align 4, !tbaa !5
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %410
  %412 = getelementptr inbounds [21 x [21 x i64]], ptr %411, i64 0, i64 0
  %413 = getelementptr inbounds [21 x i64], ptr %412, i64 0, i64 0
  %414 = load i32, ptr %15, align 4, !tbaa !5
  %415 = sext i32 %414 to i64
  %416 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %415
  %417 = load i32, ptr %28, align 4, !tbaa !5
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [21 x [21 x i64]], ptr %416, i64 0, i64 %418
  %420 = load i32, ptr %29, align 4, !tbaa !5
  %421 = sext i32 %420 to i64
  %422 = getelementptr inbounds [21 x i64], ptr %419, i64 0, i64 %421
  %423 = load i64, ptr %422, align 8, !tbaa !16
  %424 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %425 = load i32, ptr %424, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = add nsw i64 %423, %426
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %413, i64 noundef %427)
  br label %428

428:                                              ; preds = %408
  %429 = load i32, ptr %29, align 4, !tbaa !5
  %430 = add nsw i32 %429, 1
  store i32 %430, ptr %29, align 4, !tbaa !5
  br label %403, !llvm.loop !29

431:                                              ; preds = %407
  br label %432

432:                                              ; preds = %431
  %433 = load i32, ptr %28, align 4, !tbaa !5
  %434 = add nsw i32 %433, 1
  store i32 %434, ptr %28, align 4, !tbaa !5
  br label %397, !llvm.loop !30

435:                                              ; preds = %401
  %436 = load i32, ptr %15, align 4, !tbaa !5
  %437 = sext i32 %436 to i64
  %438 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %437
  %439 = getelementptr inbounds [21 x [21 x i64]], ptr %438, i64 0, i64 0
  %440 = getelementptr inbounds [21 x i64], ptr %439, i64 0, i64 0
  %441 = load i64, ptr %440, align 8, !tbaa !16
  %442 = load i64, ptr @ans, align 8, !tbaa !16
  %443 = add nsw i64 %442, %441
  store i64 %443, ptr @ans, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %444

444:                                              ; preds = %435, %185
  %445 = load i32, ptr %11, align 4, !tbaa !5
  %446 = add nsw i32 %445, 1
  store i32 %446, ptr %11, align 4, !tbaa !5
  br label %174, !llvm.loop !31

447:                                              ; preds = %178
  %448 = load i64, ptr @ans, align 8, !tbaa !16
  %449 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %448)
  ret i32 0
}

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

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

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

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

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

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

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

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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [1500001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@prime = external dso_local local_unnamed_addr global [1500001 x i32], align 16
@fact = external dso_local local_unnamed_addr global [1500001 x i32], align 16
@f = external dso_local global [2 x [21 x [21 x i64]]], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@e = external dso_local global [1500001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = srem i32 1425, %11
  %13 = add nuw nsw i32 %12, 1
  store i32 %13, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %.not130 = icmp slt i32 %14, 2
  br i1 %.not130, label %.preheader129, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %15 = sext i32 %11 to i64
  %16 = add nuw i32 %14, 1
  %wide.trip.count = zext i32 %16 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %17 = icmp eq i32 %16, 3
  br i1 %17, label %.preheader129.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %18 = and i64 %wide.trip.count, 4294967294
  %19 = add nsw i64 %18, -4
  br label %29

.preheader129.loopexit.unr-lcssa:                 ; preds = %29, %.lr.ph
  %.unr = phi i32 [ %13, %.lr.ph ], [ %43, %29 ]
  %indvars.iv.unr = phi i64 [ 2, %.lr.ph ], [ %indvars.iv.next.1, %29 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader129, label %.preheader129.loopexit.epilog-lcssa

.preheader129.loopexit.epilog-lcssa:              ; preds = %.preheader129.loopexit.unr-lcssa
  %20 = sext i32 %.unr to i64
  %21 = mul nsw i64 %20, 1394
  %22 = add nsw i64 %21, 2015
  %23 = srem i64 %22, %15
  %24 = trunc nsw i64 %23 to i32
  %25 = add i32 %24, 1
  %26 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %indvars.iv.unr
  store i32 %25, ptr %26, align 4, !tbaa !5
  br label %.preheader129

.preheader129:                                    ; preds = %.preheader129.loopexit.epilog-lcssa, %.preheader129.loopexit.unr-lcssa, %0
  %.not109136 = icmp slt i32 %11, 2
  br i1 %.not109136, label %._crit_edge, label %.lr.ph138

.lr.ph138:                                        ; preds = %.preheader129
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %27 = zext nneg i32 %11 to i64
  %28 = add nuw i32 %11, 1
  %wide.trip.count223 = zext i32 %28 to i64
  br label %45

29:                                               ; preds = %29, %.lr.ph.new
  %30 = phi i32 [ %13, %.lr.ph.new ], [ %43, %29 ]
  %indvars.iv = phi i64 [ 2, %.lr.ph.new ], [ %indvars.iv.next.1, %29 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %29 ]
  %31 = sext i32 %30 to i64
  %32 = mul nsw i64 %31, 1394
  %33 = add nsw i64 %32, 2015
  %34 = srem i64 %33, %15
  %35 = trunc nsw i64 %34 to i32
  %36 = add i32 %35, 1
  %37 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %indvars.iv
  store i32 %36, ptr %37, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %38 = sext i32 %36 to i64
  %39 = mul nsw i64 %38, 1394
  %40 = add nsw i64 %39, 2015
  %41 = srem i64 %40, %15
  %42 = trunc nsw i64 %41 to i32
  %43 = add i32 %42, 1
  %44 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %indvars.iv.next
  store i32 %43, ptr %44, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %19
  br i1 %niter.ncmp.1, label %.preheader129.loopexit.unr-lcssa, label %29, !llvm.loop !9

._crit_edge:                                      ; preds = %.critedge, %.preheader129
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 1, ptr %1, align 4, !tbaa !5
  %.not110147 = icmp slt i32 %14, 1
  br i1 %.not110147, label %._crit_edge151, label %.lr.ph150

45:                                               ; preds = %.lr.ph138, %.critedge
  %indvars.iv220 = phi i64 [ 2, %.lr.ph138 ], [ %indvars.iv.next221, %.critedge ]
  %46 = phi i32 [ %tot.promoted, %.lr.ph138 ], [ %55, %.critedge ]
  %47 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %indvars.iv220
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not124 = icmp eq i32 %48, 0
  br i1 %.not124, label %49, label %54

49:                                               ; preds = %45
  %50 = add nsw i32 %46, 1
  store i32 %50, ptr @tot, align 4, !tbaa !5
  %51 = sext i32 %46 to i64
  %52 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %51
  %53 = trunc nuw nsw i64 %indvars.iv220 to i32
  store i32 %53, ptr %52, align 4, !tbaa !5
  store i32 %53, ptr %47, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %49, %45
  %55 = phi i32 [ %50, %49 ], [ %46, %45 ]
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph133.preheader, label %.critedge

.lr.ph133.preheader:                              ; preds = %54
  %57 = zext nneg i32 %55 to i64
  %58 = trunc nuw nsw i64 %indvars.iv220 to i32
  br label %.lr.ph133

.lr.ph133:                                        ; preds = %.lr.ph133.preheader, %63
  %indvars.iv217 = phi i64 [ 0, %.lr.ph133.preheader ], [ %indvars.iv.next218, %63 ]
  %59 = getelementptr inbounds [1500001 x i32], ptr @prime, i64 0, i64 %indvars.iv217
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = mul nsw i64 %indvars.iv220, %61
  %.not125 = icmp sgt i64 %62, %27
  br i1 %.not125, label %.critedge, label %63

63:                                               ; preds = %.lr.ph133
  %64 = mul nsw i32 %60, %58
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %65
  store i32 %60, ptr %66, align 4, !tbaa !5
  %67 = srem i32 %58, %60
  %68 = icmp ne i32 %67, 0
  %indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1
  %69 = icmp ult i64 %indvars.iv.next218, %57
  %or.cond = select i1 %68, i1 %69, i1 false
  br i1 %or.cond, label %.lr.ph133, label %.critedge, !llvm.loop !11

.critedge:                                        ; preds = %.lr.ph133, %63, %54
  %indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1
  %exitcond224.not = icmp eq i64 %indvars.iv.next221, %wide.trip.count223
  br i1 %exitcond224.not, label %._crit_edge, label %45, !llvm.loop !12

._crit_edge151.loopexit:                          ; preds = %._crit_edge146
  %.pre257 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge151

._crit_edge151:                                   ; preds = %._crit_edge151.loopexit, %._crit_edge
  %70 = phi i32 [ %.pre257, %._crit_edge151.loopexit ], [ %11, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %.not111203 = icmp slt i32 %70, 1
  br i1 %.not111203, label %._crit_edge207, label %.lr.ph206

.lr.ph150:                                        ; preds = %._crit_edge, %._crit_edge146
  %71 = phi i32 [ %76, %._crit_edge146 ], [ %14, %._crit_edge ]
  %storemerge148 = phi i32 [ %78, %._crit_edge146 ], [ 1, %._crit_edge ]
  %72 = sext i32 %storemerge148 to i64
  %73 = getelementptr inbounds [1500001 x i32], ptr @a, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %.lr.ph141.preheader, label %._crit_edge146

._crit_edge146.loopexit:                          ; preds = %89
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre256 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge146

._crit_edge146:                                   ; preds = %._crit_edge146.loopexit, %.lr.ph150
  %76 = phi i32 [ %.pre256, %._crit_edge146.loopexit ], [ %71, %.lr.ph150 ]
  %77 = phi i32 [ %.pre, %._crit_edge146.loopexit ], [ %storemerge148, %.lr.ph150 ]
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %1, align 4, !tbaa !5
  %.not110.not = icmp slt i32 %77, %76
  br i1 %.not110.not, label %.lr.ph150, label %._crit_edge151.loopexit, !llvm.loop !13

.lr.ph141.preheader:                              ; preds = %.lr.ph150, %89
  %.099143 = phi i32 [ %83, %89 ], [ %74, %.lr.ph150 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %79 = zext nneg i32 %.099143 to i64
  %80 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  br label %.lr.ph141

.lr.ph141:                                        ; preds = %.lr.ph141.preheader, %.lr.ph141
  %.1100139 = phi i32 [ %83, %.lr.ph141 ], [ %.099143, %.lr.ph141.preheader ]
  %82 = phi i32 [ %84, %.lr.ph141 ], [ 0, %.lr.ph141.preheader ]
  %83 = sdiv i32 %.1100139, %81
  %84 = add nuw nsw i32 %82, 1
  %85 = sext i32 %83 to i64
  %86 = getelementptr inbounds [1500001 x i32], ptr @fact, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = icmp eq i32 %87, %81
  br i1 %88, label %.lr.ph141, label %89, !llvm.loop !14

89:                                               ; preds = %.lr.ph141
  store i32 %84, ptr %2, align 4, !tbaa !5
  %90 = sext i32 %81 to i64
  %91 = getelementptr inbounds [1500001 x %"class.std::vector"], ptr @e, i64 0, i64 %90
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %92 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %92, ptr %3, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %91, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %93 = icmp sgt i32 %83, 1
  br i1 %93, label %.lr.ph141.preheader, label %._crit_edge146.loopexit, !llvm.loop !15

._crit_edge207:                                   ; preds = %205, %._crit_edge151
  %94 = load i64, ptr @ans, align 8, !tbaa !16
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %94)
  ret i32 0

.lr.ph206:                                        ; preds = %._crit_edge151, %205
  %indvars.iv253 = phi i64 [ %indvars.iv.next254, %205 ], [ 1, %._crit_edge151 ]
  %96 = getelementptr inbounds [1500001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv253
  %97 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #8
  %.not112 = icmp eq i64 %97, 0
  br i1 %.not112, label %205, label %98

98:                                               ; preds = %.lr.ph206
  store i64 0, ptr @f, align 16, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %99 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #8
  store ptr %99, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %100 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #8
  store ptr %100, ptr %5, align 8
  %101 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %101, label %.lr.ph187, label %.lr.ph199.thread

.lr.ph199.thread:                                 ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %.lr.ph195.preheader

._crit_edge188:                                   ; preds = %._crit_edge179
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  %.not114197 = icmp slt i32 %.1278284, 0
  br i1 %.not114197, label %._crit_edge188.._crit_edge200_crit_edge, label %.lr.ph199

._crit_edge188.._crit_edge200_crit_edge:          ; preds = %._crit_edge188
  %.pre258 = zext nneg i32 %169 to i64
  br label %._crit_edge200

.lr.ph199:                                        ; preds = %._crit_edge188
  %.not116192 = icmp slt i32 %.fr208, 0
  %102 = zext nneg i32 %169 to i64
  %103 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %102
  br i1 %.not116192, label %._crit_edge200, label %.lr.ph195.preheader

.lr.ph195.preheader:                              ; preds = %.lr.ph199.thread, %.lr.ph199
  %104 = phi ptr [ @f, %.lr.ph199.thread ], [ %103, %.lr.ph199 ]
  %105 = phi i64 [ 0, %.lr.ph199.thread ], [ %102, %.lr.ph199 ]
  %.095.lcssa263271 = phi i32 [ 0, %.lr.ph199.thread ], [ %.1278284, %.lr.ph199 ]
  %.094.lcssa264270 = phi i32 [ 0, %.lr.ph199.thread ], [ %.fr208, %.lr.ph199 ]
  br label %.lr.ph195

.lr.ph187:                                        ; preds = %98, %._crit_edge179
  %.092185 = phi i32 [ %170, %._crit_edge179 ], [ 1, %98 ]
  %.093183 = phi i32 [ %169, %._crit_edge179 ], [ 0, %98 ]
  %.094182 = phi i32 [ %.fr208, %._crit_edge179 ], [ 0, %98 ]
  %.095181 = phi i32 [ %.1278284, %._crit_edge179 ], [ 0, %98 ]
  %.097180 = phi i32 [ %107, %._crit_edge179 ], [ 0, %98 ]
  %106 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %107 = load i32, ptr %106, align 4, !tbaa !18
  %108 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %109 = getelementptr inbounds i8, ptr %108, i64 4
  %110 = load i32, ptr %109, align 4, !tbaa !20
  %.fr208 = freeze i32 %110
  %111 = add nsw i32 %.097180, 1
  %112 = icmp slt i32 %111, %107
  br i1 %112, label %113, label %132

113:                                              ; preds = %.lr.ph187
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  %.not118157 = icmp slt i32 %.095181, 0
  br i1 %.not118157, label %.thread, label %.lr.ph159

.lr.ph159:                                        ; preds = %113
  %.not123152 = icmp slt i32 %.094182, 0
  %114 = zext nneg i32 %.093183 to i64
  %115 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %114
  br i1 %.not123152, label %.thread, label %.lr.ph155

.thread:                                          ; preds = %._crit_edge156, %.lr.ph159, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  %116 = xor i32 %.093183, 1
  %117 = xor i32 %.092185, 1
  br label %.lr.ph166

.lr.ph155:                                        ; preds = %.lr.ph159, %._crit_edge156
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %120

._crit_edge156:                                   ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %6, align 4, !tbaa !5
  %.not118.not = icmp slt i32 %118, %.095181
  br i1 %.not118.not, label %.lr.ph155, label %.thread, !llvm.loop !21

120:                                              ; preds = %.lr.ph155, %120
  %storemerge122153 = phi i32 [ 0, %.lr.ph155 ], [ %131, %120 ]
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = sext i32 %storemerge122153 to i64
  %124 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %114, i64 %122, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !16
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = add nsw i64 %125, %128
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %115, i64 noundef %129)
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !5
  %.not123.not = icmp slt i32 %130, %.094182
  br i1 %.not123.not, label %120, label %._crit_edge156, !llvm.loop !22

132:                                              ; preds = %.lr.ph187
  %133 = xor i32 %.093183, 1
  %134 = xor i32 %.092185, 1
  %.not119163 = icmp slt i32 %.094182, 0
  br i1 %.not119163, label %.preheader127, label %.lr.ph166

.lr.ph166:                                        ; preds = %.thread, %132
  %135 = phi i32 [ %117, %.thread ], [ %134, %132 ]
  %136 = phi i32 [ %116, %.thread ], [ %133, %132 ]
  %.1277 = phi i32 [ 0, %.thread ], [ %.094182, %132 ]
  %.196275 = phi i32 [ 0, %.thread ], [ %.095181, %132 ]
  %137 = zext nneg i32 %136 to i64
  %138 = add nsw i32 %.fr208, 1
  %139 = sext i32 %138 to i64
  %140 = shl nsw i64 %139, 3
  %141 = add nuw i32 %.1277, 1
  %wide.trip.count229 = zext i32 %141 to i64
  %xtraiter295 = and i64 %wide.trip.count229, 7
  %142 = icmp ult i32 %.1277, 7
  br i1 %142, label %.lr.ph172.unr-lcssa, label %.lr.ph166.new

.lr.ph166.new:                                    ; preds = %.lr.ph166
  %unroll_iter297 = and i64 %wide.trip.count229, 4294967288
  br label %160

.lr.ph172.unr-lcssa:                              ; preds = %160, %.lr.ph166
  %indvars.iv226.unr = phi i64 [ 0, %.lr.ph166 ], [ %indvars.iv.next227.7, %160 ]
  %lcmp.mod296.not = icmp eq i64 %xtraiter295, 0
  br i1 %lcmp.mod296.not, label %.lr.ph172, label %.epil.preheader294

.epil.preheader294:                               ; preds = %.lr.ph172.unr-lcssa, %.epil.preheader294
  %indvars.iv226.epil = phi i64 [ %indvars.iv.next227.epil, %.epil.preheader294 ], [ %indvars.iv226.unr, %.lr.ph172.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader294 ], [ 0, %.lr.ph172.unr-lcssa ]
  %143 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv226.epil
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %143, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.epil = add nuw nsw i64 %indvars.iv226.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter295
  br i1 %epil.iter.cmp.not, label %.lr.ph172, label %.epil.preheader294, !llvm.loop !23

.lr.ph172:                                        ; preds = %.epil.preheader294, %.lr.ph172.unr-lcssa
  %144 = zext nneg i32 %135 to i64
  %145 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %144
  %146 = icmp sgt i32 %.fr208, -1
  %147 = zext nneg i32 %136 to i64
  br i1 %146, label %.lr.ph172.split.us.preheader, label %.preheader127

.lr.ph172.split.us.preheader:                     ; preds = %.lr.ph172
  %148 = zext nneg i32 %.fr208 to i64
  %149 = add nuw i32 %.1277, 1
  %wide.trip.count239 = zext i32 %149 to i64
  br label %.lr.ph172.split.us

.lr.ph172.split.us:                               ; preds = %.lr.ph172.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv236 = phi i64 [ 0, %.lr.ph172.split.us.preheader ], [ %indvars.iv.next237, %..loopexit_crit_edge.us ]
  %150 = getelementptr inbounds [21 x i64], ptr %145, i64 0, i64 %indvars.iv236
  %151 = load i64, ptr %150, align 8, !tbaa !16
  %152 = icmp eq i64 %151, 4557430888798830399
  br i1 %152, label %..loopexit_crit_edge.us, label %.preheader126.us.preheader

.preheader126.us.preheader:                       ; preds = %.lr.ph172.split.us
  %153 = trunc nuw nsw i64 %indvars.iv236 to i32
  %umin = call i32 @llvm.umin.i32(i32 %.fr208, i32 %153)
  %154 = add nuw i32 %umin, 1
  %wide.trip.count234 = zext i32 %154 to i64
  br label %.preheader126.us

.preheader126.us:                                 ; preds = %.preheader126.us.preheader, %.preheader126.us
  %indvars.iv231 = phi i64 [ 0, %.preheader126.us.preheader ], [ %indvars.iv.next232, %.preheader126.us ]
  %155 = sub nsw i64 %indvars.iv236, %indvars.iv231
  %156 = sub nsw i64 %148, %indvars.iv231
  %157 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %147, i64 %155, i64 %156
  %158 = load i64, ptr %150, align 8, !tbaa !16
  %159 = add nsw i64 %158, %indvars.iv231
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %157, i64 noundef %159)
  %indvars.iv.next232 = add nuw nsw i64 %indvars.iv231, 1
  %exitcond235.not = icmp eq i64 %indvars.iv.next232, %wide.trip.count234
  br i1 %exitcond235.not, label %..loopexit_crit_edge.us, label %.preheader126.us, !llvm.loop !25

..loopexit_crit_edge.us:                          ; preds = %.preheader126.us, %.lr.ph172.split.us
  %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1
  %exitcond240.not = icmp eq i64 %indvars.iv.next237, %wide.trip.count239
  br i1 %exitcond240.not, label %.preheader127, label %.lr.ph172.split.us, !llvm.loop !26

160:                                              ; preds = %160, %.lr.ph166.new
  %indvars.iv226 = phi i64 [ 0, %.lr.ph166.new ], [ %indvars.iv.next227.7, %160 ]
  %niter298 = phi i64 [ 0, %.lr.ph166.new ], [ %niter298.next.7, %160 ]
  %161 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv226
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %161, i8 63, i64 %140, i1 false)
  %indvars.iv.next227 = or disjoint i64 %indvars.iv226, 1
  %162 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %162, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.1 = or disjoint i64 %indvars.iv226, 2
  %163 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227.1
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %163, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.2 = or disjoint i64 %indvars.iv226, 3
  %164 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227.2
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %164, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.3 = or disjoint i64 %indvars.iv226, 4
  %165 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227.3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %165, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.4 = or disjoint i64 %indvars.iv226, 5
  %166 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227.4
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %166, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.5 = or disjoint i64 %indvars.iv226, 6
  %167 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227.5
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %167, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.6 = or disjoint i64 %indvars.iv226, 7
  %168 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %137, i64 %indvars.iv.next227.6
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %168, i8 63, i64 %140, i1 false)
  %indvars.iv.next227.7 = add nuw nsw i64 %indvars.iv226, 8
  %niter298.next.7 = add i64 %niter298, 8
  %niter298.ncmp.7 = icmp eq i64 %niter298.next.7, %unroll_iter297
  br i1 %niter298.ncmp.7, label %.lr.ph172.unr-lcssa, label %160, !llvm.loop !27

.preheader127:                                    ; preds = %..loopexit_crit_edge.us, %132, %.lr.ph172
  %.196276285 = phi i32 [ %.196275, %.lr.ph172 ], [ %.095181, %132 ], [ %.196275, %..loopexit_crit_edge.us ]
  %.1278284 = phi i32 [ %.1277, %.lr.ph172 ], [ %.094182, %132 ], [ %.1277, %..loopexit_crit_edge.us ]
  %169 = phi i32 [ %136, %.lr.ph172 ], [ %133, %132 ], [ %136, %..loopexit_crit_edge.us ]
  %170 = phi i32 [ %135, %.lr.ph172 ], [ %134, %132 ], [ %135, %..loopexit_crit_edge.us ]
  %.not121177 = icmp slt i32 %.196276285, 1
  br i1 %.not121177, label %._crit_edge179, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader127
  %invariant.smin = call i32 @llvm.smin.i32(i32 %.1278284, i32 %.fr208)
  %171 = icmp sgt i32 %invariant.smin, -1
  %172 = zext nneg i32 %169 to i64
  %173 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %172
  %174 = zext nneg i32 %170 to i64
  br i1 %171, label %.preheader.us.preheader, label %._crit_edge179

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %175 = sext i32 %.fr208 to i64
  %176 = add nuw i32 %invariant.smin, 1
  %177 = add nuw i32 %.196276285, 1
  %wide.trip.count249 = zext i32 %177 to i64
  %wide.trip.count244 = zext i32 %176 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge176.us
  %indvars.iv246 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next247, %._crit_edge176.us ]
  br label %178

178:                                              ; preds = %.preheader.us, %178
  %indvars.iv241 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next242, %178 ]
  %179 = sub nsw i64 %175, %indvars.iv241
  %180 = getelementptr inbounds [21 x i64], ptr %173, i64 0, i64 %179
  %181 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %174, i64 %indvars.iv246, i64 %indvars.iv241
  %182 = load i64, ptr %181, align 8, !tbaa !16
  %183 = add nsw i64 %182, %indvars.iv241
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %180, i64 noundef %183)
  %indvars.iv.next242 = add nuw nsw i64 %indvars.iv241, 1
  %exitcond245.not = icmp eq i64 %indvars.iv.next242, %wide.trip.count244
  br i1 %exitcond245.not, label %._crit_edge176.us, label %178, !llvm.loop !28

._crit_edge176.us:                                ; preds = %178
  %indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1
  %exitcond250.not = icmp eq i64 %indvars.iv.next247, %wide.trip.count249
  br i1 %exitcond250.not, label %._crit_edge179, label %.preheader.us, !llvm.loop !29

._crit_edge179:                                   ; preds = %._crit_edge176.us, %.preheader.lr.ph, %.preheader127
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %185 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #8
  store ptr %185, ptr %5, align 8
  %186 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %186, label %.lr.ph187, label %._crit_edge188, !llvm.loop !30

._crit_edge200:                                   ; preds = %._crit_edge196, %.lr.ph199, %._crit_edge188.._crit_edge200_crit_edge
  %.pre-phi = phi i64 [ %.pre258, %._crit_edge188.._crit_edge200_crit_edge ], [ %102, %.lr.ph199 ], [ %105, %._crit_edge196 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  %187 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %.pre-phi
  %188 = load i64, ptr %187, align 8, !tbaa !16
  %189 = load i64, ptr @ans, align 8, !tbaa !16
  %190 = add nsw i64 %189, %188
  store i64 %190, ptr @ans, align 8, !tbaa !16
  br label %205

.lr.ph195:                                        ; preds = %.lr.ph195.preheader, %._crit_edge196
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %193

._crit_edge196:                                   ; preds = %193
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %8, align 4, !tbaa !5
  %.not114.not = icmp slt i32 %191, %.095.lcssa263271
  br i1 %.not114.not, label %.lr.ph195, label %._crit_edge200, !llvm.loop !31

193:                                              ; preds = %.lr.ph195, %193
  %storemerge115193 = phi i32 [ 0, %.lr.ph195 ], [ %204, %193 ]
  %194 = load i32, ptr %8, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = sext i32 %storemerge115193 to i64
  %197 = getelementptr inbounds [2 x [21 x [21 x i64]]], ptr @f, i64 0, i64 %105, i64 %195, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !16
  %199 = 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)
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = add nsw i64 %198, %201
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %104, i64 noundef %202)
  %203 = load i32, ptr %9, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %9, align 4, !tbaa !5
  %.not116.not = icmp slt i32 %203, %.094.lcssa264270
  br i1 %.not116.not, label %193, label %._crit_edge196, !llvm.loop !32

205:                                              ; preds = %.lr.ph206, %._crit_edge200
  %indvars.iv.next254 = add nuw nsw i64 %indvars.iv253, 1
  %206 = load i32, ptr @m, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %.not111.not = icmp slt i64 %indvars.iv253, %207
  br i1 %.not111.not, label %.lr.ph206, label %._crit_edge207, !llvm.loop !33
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__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 #4

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

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

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

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

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

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

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

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

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

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

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


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