; LLVM IR from tangjz/acm-icpc :: 51nod/1162.ll (Z15quadratic_sieven)

; 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::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [32 x i64] }
%"class.std::bitset.0" = type { %"struct.std::_Base_bitset.1" }
%"struct.std::_Base_bitset.1" = type { [33 x i64] }
%"class.std::bitset<2001>::reference" = type { ptr, i64 }
%"class.std::bitset<2051>::reference" = type { ptr, i64 }

@ptot = external dso_local global i32, align 4
@pr = external dso_local global [50001 x i32], align 16
@qtot = external dso_local global i32, align 4
@qr = external dso_local global [2001 x i32], align 16
@stot = external dso_local global i32, align 4
@seq = external dso_local global [15000001 x double], align 16
@num = external dso_local global [2051 x i64], align 16
@msk = external dso_local global [2051 x %"class.std::bitset"], align 16
@ex = external dso_local global [2051 x %"class.std::bitset"], align 16
@sel = external dso_local global [2051 x %"class.std::bitset.0"], align 16
@_ZZ15quadratic_sievenE3cnt = external hidden global [2001 x i32], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef { i64, i64 } @_Z7mod_mulnnn(i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef { i64, i64 } @_Z7mod_pownnn(i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef { i64, i64 } @_Z15quadratic_sieven(i64 noundef %0, i64 noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i128, align 16
  %4 = alloca i128, align 16
  %5 = alloca i128, align 16
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i128, align 16
  %17 = alloca i32, align 4
  %18 = alloca i128, align 16
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::bitset<2001>::reference", align 8
  %21 = alloca %"class.std::bitset<2001>::reference", align 8
  %22 = alloca ptr, align 8
  %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 %"class.std::bitset<2001>::reference", align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.std::bitset<2001>::reference", align 8
  %31 = alloca i1, align 1
  %32 = alloca i1, align 1
  %33 = alloca i32, align 4
  %34 = alloca i128, align 16
  %35 = alloca i128, align 16
  %36 = alloca i32, align 4
  %37 = alloca %"class.std::bitset<2051>::reference", align 8
  %38 = alloca i128, align 16
  %39 = alloca i128, align 16
  %40 = alloca i128, align 16
  %41 = alloca i128, align 16
  %42 = alloca i32, align 4
  %43 = alloca %"class.std::bitset<2001>::reference", align 8
  %44 = alloca i32, align 4
  %45 = alloca i128, align 16
  %46 = alloca i128, align 16
  %47 = alloca i128, align 16
  %48 = alloca i128, align 16
  %49 = alloca i128, align 16
  %50 = alloca i128, align 16
  %51 = alloca i128, align 16
  %52 = alloca i128, align 16
  %53 = alloca i128, align 16
  %54 = alloca i128, align 16
  %55 = alloca i128, align 16
  %56 = alloca i128, align 16
  %57 = alloca i128, align 16
  %58 = alloca i128, align 16
  %59 = alloca i128, align 16
  %60 = alloca i128, align 16
  %61 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  store i64 %0, ptr %61, align 16
  %62 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  store i64 %1, ptr %62, align 8
  %63 = load i128, ptr %4, align 16, !tbaa !5
  store i128 %63, ptr %5, align 16, !tbaa !5
  store i32 0, ptr @qtot, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %111, %2
  %65 = load i32, ptr %6, align 4, !tbaa !9
  %66 = load i32, ptr @ptot, align 4, !tbaa !9
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %71

68:                                               ; preds = %64
  %69 = load i32, ptr @qtot, align 4, !tbaa !9
  %70 = icmp slt i32 %69, 2001
  br label %71

71:                                               ; preds = %68, %64
  %72 = phi i1 [ false, %64 ], [ %70, %68 ]
  br i1 %72, label %74, label %73

73:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %114

74:                                               ; preds = %71
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [50001 x i32], ptr @pr, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = icmp eq i32 %78, 2
  br i1 %79, label %101, label %80

80:                                               ; preds = %74
  %81 = load i128, ptr %5, align 16, !tbaa !5
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50001 x i32], ptr @pr, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = sext i32 %85 to i128
  %87 = srem i128 %81, %86
  %88 = trunc i128 %87 to i32
  %89 = load i32, ptr %6, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50001 x i32], ptr @pr, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = sub nsw i32 %92, 1
  %94 = ashr i32 %93, 1
  %95 = load i32, ptr %6, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [50001 x i32], ptr @pr, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = call noundef i32 @_Z7mod_powiii(i32 noundef %88, i32 noundef %94, i32 noundef %98)
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %110

101:                                              ; preds = %80, %74
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50001 x i32], ptr @pr, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load i32, ptr @qtot, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr @qtot, align 4, !tbaa !9
  %108 = sext i32 %106 to i64
  %109 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %108
  store i32 %105, ptr %109, align 4, !tbaa !9
  br label %110

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

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

114:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %115 = load i128, ptr %5, align 16, !tbaa !5
  %116 = sitofp i128 %115 to double
  %117 = call double @sqrt(double noundef %116) #7
  %118 = fptosi double %117 to i64
  store i64 %118, ptr %7, align 8, !tbaa !13
  br label %119

119:                                              ; preds = %128, %114
  %120 = load i64, ptr %7, align 8, !tbaa !13
  %121 = sext i64 %120 to i128
  %122 = load i64, ptr %7, align 8, !tbaa !13
  %123 = sext i64 %122 to i128
  %124 = mul nsw i128 %121, %123
  %125 = load i128, ptr %5, align 16, !tbaa !5
  %126 = icmp sle i128 %124, %125
  br i1 %126, label %127, label %131

127:                                              ; preds = %119
  br label %128

128:                                              ; preds = %127
  %129 = load i64, ptr %7, align 8, !tbaa !13
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %7, align 8, !tbaa !13
  br label %119, !llvm.loop !15

131:                                              ; preds = %119
  %132 = load i64, ptr %7, align 8, !tbaa !13
  %133 = sext i64 %132 to i128
  %134 = load i64, ptr %7, align 8, !tbaa !13
  %135 = sext i64 %134 to i128
  %136 = mul nsw i128 %133, %135
  %137 = load i128, ptr %5, align 16, !tbaa !5
  %138 = sub nsw i128 %136, %137
  %139 = sitofp i128 %138 to double
  store double %139, ptr @seq, align 16, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %161, %131
  %141 = load i32, ptr %8, align 4, !tbaa !9
  %142 = icmp slt i32 %141, 15000001
  br i1 %142, label %144, label %143

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

144:                                              ; preds = %140
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %146
  %148 = load double, ptr %147, align 8, !tbaa !16
  %149 = load i64, ptr %7, align 8, !tbaa !13
  %150 = load i32, ptr %8, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = add nsw i64 %149, %151
  %153 = shl i64 %152, 1
  %154 = or i64 %153, 1
  %155 = sitofp i64 %154 to double
  %156 = fadd double %148, %155
  %157 = load i32, ptr %8, align 4, !tbaa !9
  %158 = add nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %159
  store double %156, ptr %160, align 8, !tbaa !16
  br label %161

161:                                              ; preds = %144
  %162 = load i32, ptr %8, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %8, align 4, !tbaa !9
  br label %140, !llvm.loop !18

164:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %165

165:                                              ; preds = %232, %164
  %166 = load i32, ptr %9, align 4, !tbaa !9
  %167 = load i32, ptr @qtot, align 4, !tbaa !9
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %170, label %169

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

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %171 = load i32, ptr %9, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !9
  store i32 %174, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %175 = load i64, ptr %7, align 8, !tbaa !13
  %176 = sext i64 %175 to i128
  %177 = load i64, ptr %7, align 8, !tbaa !13
  %178 = sext i64 %177 to i128
  %179 = mul nsw i128 %176, %178
  %180 = load i128, ptr %5, align 16, !tbaa !5
  %181 = sub nsw i128 %179, %180
  %182 = load i32, ptr %11, align 4, !tbaa !9
  %183 = sext i32 %182 to i128
  %184 = srem i128 %181, %183
  %185 = trunc i128 %184 to i32
  store i32 %185, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %186 = load i64, ptr %7, align 8, !tbaa !13
  %187 = load i32, ptr %11, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = srem i64 %186, %188
  %190 = trunc i64 %189 to i32
  store i32 %190, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %228, %170
  %192 = load i32, ptr %14, align 4, !tbaa !9
  %193 = load i32, ptr %11, align 4, !tbaa !9
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %231

196:                                              ; preds = %191
  %197 = load i32, ptr %12, align 4, !tbaa !9
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %218, label %199

199:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %200 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %200, ptr %15, align 4, !tbaa !9
  br label %201

201:                                              ; preds = %213, %199
  %202 = load i32, ptr %15, align 4, !tbaa !9
  %203 = icmp slt i32 %202, 15000001
  br i1 %203, label %205, label %204

204:                                              ; preds = %201
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %217

205:                                              ; preds = %201
  %206 = load i32, ptr %11, align 4, !tbaa !9
  %207 = sitofp i32 %206 to double
  %208 = load i32, ptr %15, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %209
  %211 = load double, ptr %210, align 8, !tbaa !16
  %212 = fdiv double %211, %207
  store double %212, ptr %210, align 8, !tbaa !16
  br label %213

213:                                              ; preds = %205
  %214 = load i32, ptr %11, align 4, !tbaa !9
  %215 = load i32, ptr %15, align 4, !tbaa !9
  %216 = add nsw i32 %215, %214
  store i32 %216, ptr %15, align 4, !tbaa !9
  br label %201, !llvm.loop !19

217:                                              ; preds = %204
  br label %218

218:                                              ; preds = %217, %196
  %219 = load i32, ptr %12, align 4, !tbaa !9
  %220 = load i32, ptr %13, align 4, !tbaa !9
  %221 = load i32, ptr %14, align 4, !tbaa !9
  %222 = add nsw i32 %220, %221
  %223 = shl i32 %222, 1
  %224 = or i32 %223, 1
  %225 = add nsw i32 %219, %224
  %226 = load i32, ptr %11, align 4, !tbaa !9
  %227 = srem i32 %225, %226
  store i32 %227, ptr %12, align 4, !tbaa !9
  br label %228

228:                                              ; preds = %218
  %229 = load i32, ptr %14, align 4, !tbaa !9
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %14, align 4, !tbaa !9
  br label %191, !llvm.loop !20

231:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %9, align 4, !tbaa !9
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %9, align 4, !tbaa !9
  br label %165, !llvm.loop !21

235:                                              ; preds = %169
  store i32 0, ptr @stot, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  %236 = load i64, ptr %7, align 8, !tbaa !13
  %237 = sext i64 %236 to i128
  %238 = load i64, ptr %7, align 8, !tbaa !13
  %239 = sext i64 %238 to i128
  %240 = mul nsw i128 %237, %239
  %241 = load i128, ptr %5, align 16, !tbaa !5
  %242 = sub nsw i128 %240, %241
  store i128 %242, ptr %16, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %243

243:                                              ; preds = %334, %235
  %244 = load i32, ptr %17, align 4, !tbaa !9
  %245 = icmp slt i32 %244, 15000001
  br i1 %245, label %246, label %249

246:                                              ; preds = %243
  %247 = load i32, ptr @stot, align 4, !tbaa !9
  %248 = icmp slt i32 %247, 2051
  br label %249

249:                                              ; preds = %246, %243
  %250 = phi i1 [ false, %243 ], [ %248, %246 ]
  br i1 %250, label %252, label %251

251:                                              ; preds = %249
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %337

252:                                              ; preds = %249
  %253 = load i32, ptr %17, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %254
  %256 = load double, ptr %255, align 8, !tbaa !16
  %257 = fsub double %256, 1.000000e+00
  %258 = call double @llvm.fabs.f64(double %257)
  %259 = fcmp ole double %258, 1.000000e-09
  br i1 %259, label %260, label %324

260:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %261 = load i128, ptr %16, align 16, !tbaa !5
  store i128 %261, ptr %18, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %262

262:                                              ; preds = %302, %260
  %263 = load i32, ptr %19, align 4, !tbaa !9
  %264 = load i32, ptr @qtot, align 4, !tbaa !9
  %265 = icmp slt i32 %263, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %262
  store i32 23, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %305

267:                                              ; preds = %262
  %268 = load i128, ptr %18, align 16, !tbaa !5
  %269 = load i32, ptr %19, align 4, !tbaa !9
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !9
  %273 = sext i32 %272 to i128
  %274 = srem i128 %268, %273
  %275 = icmp eq i128 %274, 0
  br i1 %275, label %276, label %301

276:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %277 = load i32, ptr @stot, align 4, !tbaa !9
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %278
  %280 = load i32, ptr %19, align 4, !tbaa !9
  %281 = sext i32 %280 to i64
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<2001>::reference") align 8 %20, ptr noundef nonnull align 8 dereferenceable(256) %279, i64 noundef %281)
  %282 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %20, i1 noundef zeroext true) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %283 = load i32, ptr @stot, align 4, !tbaa !9
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @ex, i64 0, i64 %284
  %286 = load i32, ptr %19, align 4, !tbaa !9
  %287 = sext i32 %286 to i64
  invoke void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<2001>::reference") align 8 %21, ptr noundef nonnull align 8 dereferenceable(256) %285, i64 noundef %287)
          to label %288 unwind label %297

288:                                              ; preds = %276
  %289 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %282) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  %290 = load i32, ptr %19, align 4, !tbaa !9
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !9
  %294 = sext i32 %293 to i128
  %295 = load i128, ptr %18, align 16, !tbaa !5
  %296 = sdiv i128 %295, %294
  store i128 %296, ptr %18, align 16, !tbaa !5
  br label %301

297:                                              ; preds = %276
  %298 = landingpad { ptr, i32 }
          cleanup
  %299 = extractvalue { ptr, i32 } %298, 0
  store ptr %299, ptr %22, align 8
  %300 = extractvalue { ptr, i32 } %298, 1
  store i32 %300, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %660

301:                                              ; preds = %288, %267
  br label %302

302:                                              ; preds = %301
  %303 = load i32, ptr %19, align 4, !tbaa !9
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %19, align 4, !tbaa !9
  br label %262, !llvm.loop !22

305:                                              ; preds = %266
  %306 = load i32, ptr @stot, align 4, !tbaa !9
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %307
  %309 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EE5resetEv(ptr noundef nonnull align 8 dereferenceable(264) %308) #7
  %310 = load i32, ptr @stot, align 4, !tbaa !9
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %311
  %313 = load i32, ptr @stot, align 4, !tbaa !9
  %314 = sext i32 %313 to i64
  %315 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EE3setEmb(ptr noundef nonnull align 8 dereferenceable(264) %312, i64 noundef %314, i1 noundef zeroext true)
  %316 = load i64, ptr %7, align 8, !tbaa !13
  %317 = load i32, ptr %17, align 4, !tbaa !9
  %318 = sext i32 %317 to i64
  %319 = add nsw i64 %316, %318
  %320 = load i32, ptr @stot, align 4, !tbaa !9
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr @stot, align 4, !tbaa !9
  %322 = sext i32 %320 to i64
  %323 = getelementptr inbounds [2051 x i64], ptr @num, i64 0, i64 %322
  store i64 %319, ptr %323, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  br label %324

324:                                              ; preds = %305, %252
  %325 = load i64, ptr %7, align 8, !tbaa !13
  %326 = load i32, ptr %17, align 4, !tbaa !9
  %327 = sext i32 %326 to i64
  %328 = add nsw i64 %325, %327
  %329 = shl i64 %328, 1
  %330 = or i64 %329, 1
  %331 = sext i64 %330 to i128
  %332 = load i128, ptr %16, align 16, !tbaa !5
  %333 = add nsw i128 %332, %331
  store i128 %333, ptr %16, align 16, !tbaa !5
  br label %334

334:                                              ; preds = %324
  %335 = load i32, ptr %17, align 4, !tbaa !9
  %336 = add nsw i32 %335, 1
  store i32 %336, ptr %17, align 4, !tbaa !9
  br label %243, !llvm.loop !23

337:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %338

338:                                              ; preds = %430, %337
  %339 = load i32, ptr %25, align 4, !tbaa !9
  %340 = load i32, ptr @qtot, align 4, !tbaa !9
  %341 = icmp slt i32 %339, %340
  br i1 %341, label %343, label %342

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

343:                                              ; preds = %338
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 -1, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %344 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %344, ptr %27, align 4, !tbaa !9
  br label %345

345:                                              ; preds = %360, %343
  %346 = load i32, ptr %27, align 4, !tbaa !9
  %347 = load i32, ptr @stot, align 4, !tbaa !9
  %348 = icmp slt i32 %346, %347
  br i1 %348, label %350, label %349

349:                                              ; preds = %345
  store i32 29, ptr %10, align 4
  br label %363

350:                                              ; preds = %345
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  %351 = load i32, ptr %27, align 4, !tbaa !9
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %352
  %354 = load i32, ptr %25, align 4, !tbaa !9
  %355 = sext i32 %354 to i64
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<2001>::reference") align 8 %28, ptr noundef nonnull align 8 dereferenceable(256) %353, i64 noundef %355)
  %356 = call noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %28) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  br i1 %356, label %357, label %359

357:                                              ; preds = %350
  %358 = load i32, ptr %27, align 4, !tbaa !9
  store i32 %358, ptr %26, align 4, !tbaa !9
  store i32 29, ptr %10, align 4
  br label %363

359:                                              ; preds = %350
  br label %360

360:                                              ; preds = %359
  %361 = load i32, ptr %27, align 4, !tbaa !9
  %362 = add nsw i32 %361, 1
  store i32 %362, ptr %27, align 4, !tbaa !9
  br label %345, !llvm.loop !24

363:                                              ; preds = %357, %349
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %364

364:                                              ; preds = %363
  %365 = load i32, ptr %26, align 4, !tbaa !9
  %366 = icmp eq i32 %365, -1
  br i1 %366, label %367, label %368

367:                                              ; preds = %364
  store i32 28, ptr %10, align 4
  br label %427

368:                                              ; preds = %364
  %369 = load i32, ptr %24, align 4, !tbaa !9
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %370
  %372 = load i32, ptr %26, align 4, !tbaa !9
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %373
  call void @_ZSt4swapISt6bitsetILm2001EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(256) %371, ptr noundef nonnull align 8 dereferenceable(256) %374) #7
  %375 = load i32, ptr %24, align 4, !tbaa !9
  %376 = sext i32 %375 to i64
  %377 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %376
  %378 = load i32, ptr %26, align 4, !tbaa !9
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %379
  call void @_ZSt4swapISt6bitsetILm2051EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(264) %377, ptr noundef nonnull align 8 dereferenceable(264) %380) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %381

381:                                              ; preds = %421, %368
  %382 = load i32, ptr %29, align 4, !tbaa !9
  %383 = load i32, ptr @stot, align 4, !tbaa !9
  %384 = icmp slt i32 %382, %383
  br i1 %384, label %386, label %385

385:                                              ; preds = %381
  store i32 32, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %424

386:                                              ; preds = %381
  %387 = load i32, ptr %29, align 4, !tbaa !9
  %388 = load i32, ptr %24, align 4, !tbaa !9
  %389 = icmp ne i32 %387, %388
  store i1 false, ptr %31, align 1
  store i1 false, ptr %32, align 1
  br i1 %389, label %390, label %397

390:                                              ; preds = %386
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #7
  store i1 true, ptr %31, align 1
  %391 = load i32, ptr %29, align 4, !tbaa !9
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %392
  %394 = load i32, ptr %25, align 4, !tbaa !9
  %395 = sext i32 %394 to i64
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<2001>::reference") align 8 %30, ptr noundef nonnull align 8 dereferenceable(256) %393, i64 noundef %395)
  store i1 true, ptr %32, align 1
  %396 = call noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %30) #7
  br label %397

397:                                              ; preds = %390, %386
  %398 = phi i1 [ false, %386 ], [ %396, %390 ]
  %399 = load i1, ptr %32, align 1
  br i1 %399, label %400, label %401

400:                                              ; preds = %397
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %30) #7
  br label %401

401:                                              ; preds = %400, %397
  %402 = load i1, ptr %31, align 1
  br i1 %402, label %403, label %404

403:                                              ; preds = %401
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  br label %404

404:                                              ; preds = %403, %401
  br i1 %398, label %405, label %420

405:                                              ; preds = %404
  %406 = load i32, ptr %24, align 4, !tbaa !9
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %407
  %409 = load i32, ptr %29, align 4, !tbaa !9
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %410
  %412 = call noundef nonnull align 8 dereferenceable(256) ptr @_ZNSt6bitsetILm2001EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(256) %411, ptr noundef nonnull align 8 dereferenceable(256) %408) #7
  %413 = load i32, ptr %24, align 4, !tbaa !9
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %414
  %416 = load i32, ptr %29, align 4, !tbaa !9
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %417
  %419 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(264) %418, ptr noundef nonnull align 8 dereferenceable(264) %415) #7
  br label %420

420:                                              ; preds = %405, %404
  br label %421

421:                                              ; preds = %420
  %422 = load i32, ptr %29, align 4, !tbaa !9
  %423 = add nsw i32 %422, 1
  store i32 %423, ptr %29, align 4, !tbaa !9
  br label %381, !llvm.loop !25

424:                                              ; preds = %385
  %425 = load i32, ptr %24, align 4, !tbaa !9
  %426 = add nsw i32 %425, 1
  store i32 %426, ptr %24, align 4, !tbaa !9
  store i32 0, ptr %10, align 4
  br label %427

427:                                              ; preds = %424, %367
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  %428 = load i32, ptr %10, align 4
  switch i32 %428, label %665 [
    i32 0, label %429
    i32 28, label %430
  ]

429:                                              ; preds = %427
  br label %430

430:                                              ; preds = %429, %427
  %431 = load i32, ptr %25, align 4, !tbaa !9
  %432 = add nsw i32 %431, 1
  store i32 %432, ptr %25, align 4, !tbaa !9
  br label %338, !llvm.loop !26

433:                                              ; preds = %342
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %434 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %434, ptr %33, align 4, !tbaa !9
  br label %435

435:                                              ; preds = %651, %433
  %436 = load i32, ptr %33, align 4, !tbaa !9
  %437 = load i32, ptr @stot, align 4, !tbaa !9
  %438 = icmp slt i32 %436, %437
  br i1 %438, label %440, label %439

439:                                              ; preds = %435
  store i32 35, ptr %10, align 4
  br label %654

440:                                              ; preds = %435
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #7
  store i128 1, ptr %34, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #7
  store i128 1, ptr %35, align 16, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ15quadratic_sievenE3cnt, i8 0, i64 8004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  store i32 0, ptr %36, align 4, !tbaa !9
  br label %441

441:                                              ; preds = %502, %440
  %442 = load i32, ptr %36, align 4, !tbaa !9
  %443 = load i32, ptr @stot, align 4, !tbaa !9
  %444 = icmp slt i32 %442, %443
  br i1 %444, label %446, label %445

445:                                              ; preds = %441
  store i32 38, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %505

446:                                              ; preds = %441
  call void @llvm.lifetime.start.p0(i64 16, ptr %37) #7
  %447 = load i32, ptr %33, align 4, !tbaa !9
  %448 = sext i32 %447 to i64
  %449 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %448
  %450 = load i32, ptr %36, align 4, !tbaa !9
  %451 = sext i32 %450 to i64
  call void @_ZNSt6bitsetILm2051EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<2051>::reference") align 8 %37, ptr noundef nonnull align 8 dereferenceable(264) %449, i64 noundef %451)
  %452 = call noundef zeroext i1 @_ZNKSt6bitsetILm2051EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %37) #7
  call void @_ZNSt6bitsetILm2051EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %37) #7
  br i1 %452, label %453, label %501

453:                                              ; preds = %446
  %454 = load i128, ptr %34, align 16, !tbaa !5
  %455 = load i32, ptr %36, align 4, !tbaa !9
  %456 = sext i32 %455 to i64
  %457 = getelementptr inbounds [2051 x i64], ptr @num, i64 0, i64 %456
  %458 = load i64, ptr %457, align 8, !tbaa !13
  %459 = sext i64 %458 to i128
  %460 = load i128, ptr %5, align 16, !tbaa !5
  store i128 %454, ptr %38, align 16, !tbaa !5
  %461 = getelementptr inbounds { i64, i64 }, ptr %38, i32 0, i32 0
  %462 = load i64, ptr %461, align 16
  %463 = getelementptr inbounds { i64, i64 }, ptr %38, i32 0, i32 1
  %464 = load i64, ptr %463, align 8
  store i128 %459, ptr %39, align 16, !tbaa !5
  %465 = getelementptr inbounds { i64, i64 }, ptr %39, i32 0, i32 0
  %466 = load i64, ptr %465, align 16
  %467 = getelementptr inbounds { i64, i64 }, ptr %39, i32 0, i32 1
  %468 = load i64, ptr %467, align 8
  store i128 %460, ptr %40, align 16, !tbaa !5
  %469 = getelementptr inbounds { i64, i64 }, ptr %40, i32 0, i32 0
  %470 = load i64, ptr %469, align 16
  %471 = getelementptr inbounds { i64, i64 }, ptr %40, i32 0, i32 1
  %472 = load i64, ptr %471, align 8
  %473 = call noundef { i64, i64 } @_Z7mod_mulnnn(i64 noundef %462, i64 noundef %464, i64 noundef %466, i64 noundef %468, i64 noundef %470, i64 noundef %472)
  %474 = getelementptr inbounds { i64, i64 }, ptr %41, i32 0, i32 0
  %475 = extractvalue { i64, i64 } %473, 0
  store i64 %475, ptr %474, align 16
  %476 = getelementptr inbounds { i64, i64 }, ptr %41, i32 0, i32 1
  %477 = extractvalue { i64, i64 } %473, 1
  store i64 %477, ptr %476, align 8
  %478 = load i128, ptr %41, align 16, !tbaa !5
  store i128 %478, ptr %34, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  store i32 0, ptr %42, align 4, !tbaa !9
  br label %479

479:                                              ; preds = %497, %453
  %480 = load i32, ptr %42, align 4, !tbaa !9
  %481 = load i32, ptr @qtot, align 4, !tbaa !9
  %482 = icmp slt i32 %480, %481
  br i1 %482, label %484, label %483

483:                                              ; preds = %479
  store i32 41, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  br label %500

484:                                              ; preds = %479
  call void @llvm.lifetime.start.p0(i64 16, ptr %43) #7
  %485 = load i32, ptr %36, align 4, !tbaa !9
  %486 = sext i32 %485 to i64
  %487 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @ex, i64 0, i64 %486
  %488 = load i32, ptr %42, align 4, !tbaa !9
  %489 = sext i32 %488 to i64
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<2001>::reference") align 8 %43, ptr noundef nonnull align 8 dereferenceable(256) %487, i64 noundef %489)
  %490 = call noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %43) #7
  %491 = zext i1 %490 to i32
  %492 = load i32, ptr %42, align 4, !tbaa !9
  %493 = sext i32 %492 to i64
  %494 = getelementptr inbounds [2001 x i32], ptr @_ZZ15quadratic_sievenE3cnt, i64 0, i64 %493
  %495 = load i32, ptr %494, align 4, !tbaa !9
  %496 = add nsw i32 %495, %491
  store i32 %496, ptr %494, align 4, !tbaa !9
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %43) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %43) #7
  br label %497

497:                                              ; preds = %484
  %498 = load i32, ptr %42, align 4, !tbaa !9
  %499 = add nsw i32 %498, 1
  store i32 %499, ptr %42, align 4, !tbaa !9
  br label %479, !llvm.loop !27

500:                                              ; preds = %483
  br label %501

501:                                              ; preds = %500, %446
  br label %502

502:                                              ; preds = %501
  %503 = load i32, ptr %36, align 4, !tbaa !9
  %504 = add nsw i32 %503, 1
  store i32 %504, ptr %36, align 4, !tbaa !9
  br label %441, !llvm.loop !28

505:                                              ; preds = %445
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #7
  store i32 0, ptr %44, align 4, !tbaa !9
  br label %506

506:                                              ; preds = %562, %505
  %507 = load i32, ptr %44, align 4, !tbaa !9
  %508 = load i32, ptr @qtot, align 4, !tbaa !9
  %509 = icmp slt i32 %507, %508
  br i1 %509, label %511, label %510

510:                                              ; preds = %506
  store i32 44, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  br label %565

511:                                              ; preds = %506
  %512 = load i128, ptr %35, align 16, !tbaa !5
  %513 = load i32, ptr %44, align 4, !tbaa !9
  %514 = sext i32 %513 to i64
  %515 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %514
  %516 = load i32, ptr %515, align 4, !tbaa !9
  %517 = sext i32 %516 to i128
  %518 = load i32, ptr %44, align 4, !tbaa !9
  %519 = sext i32 %518 to i64
  %520 = getelementptr inbounds [2001 x i32], ptr @_ZZ15quadratic_sievenE3cnt, i64 0, i64 %519
  %521 = load i32, ptr %520, align 4, !tbaa !9
  %522 = ashr i32 %521, 1
  %523 = sext i32 %522 to i128
  %524 = load i128, ptr %5, align 16, !tbaa !5
  store i128 %517, ptr %45, align 16, !tbaa !5
  %525 = getelementptr inbounds { i64, i64 }, ptr %45, i32 0, i32 0
  %526 = load i64, ptr %525, align 16
  %527 = getelementptr inbounds { i64, i64 }, ptr %45, i32 0, i32 1
  %528 = load i64, ptr %527, align 8
  store i128 %523, ptr %46, align 16, !tbaa !5
  %529 = getelementptr inbounds { i64, i64 }, ptr %46, i32 0, i32 0
  %530 = load i64, ptr %529, align 16
  %531 = getelementptr inbounds { i64, i64 }, ptr %46, i32 0, i32 1
  %532 = load i64, ptr %531, align 8
  store i128 %524, ptr %47, align 16, !tbaa !5
  %533 = getelementptr inbounds { i64, i64 }, ptr %47, i32 0, i32 0
  %534 = load i64, ptr %533, align 16
  %535 = getelementptr inbounds { i64, i64 }, ptr %47, i32 0, i32 1
  %536 = load i64, ptr %535, align 8
  %537 = call noundef { i64, i64 } @_Z7mod_pownnn(i64 noundef %526, i64 noundef %528, i64 noundef %530, i64 noundef %532, i64 noundef %534, i64 noundef %536)
  %538 = getelementptr inbounds { i64, i64 }, ptr %48, i32 0, i32 0
  %539 = extractvalue { i64, i64 } %537, 0
  store i64 %539, ptr %538, align 16
  %540 = getelementptr inbounds { i64, i64 }, ptr %48, i32 0, i32 1
  %541 = extractvalue { i64, i64 } %537, 1
  store i64 %541, ptr %540, align 8
  %542 = load i128, ptr %48, align 16, !tbaa !5
  %543 = load i128, ptr %5, align 16, !tbaa !5
  store i128 %512, ptr %49, align 16, !tbaa !5
  %544 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 0
  %545 = load i64, ptr %544, align 16
  %546 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 1
  %547 = load i64, ptr %546, align 8
  store i128 %542, ptr %50, align 16, !tbaa !5
  %548 = getelementptr inbounds { i64, i64 }, ptr %50, i32 0, i32 0
  %549 = load i64, ptr %548, align 16
  %550 = getelementptr inbounds { i64, i64 }, ptr %50, i32 0, i32 1
  %551 = load i64, ptr %550, align 8
  store i128 %543, ptr %51, align 16, !tbaa !5
  %552 = getelementptr inbounds { i64, i64 }, ptr %51, i32 0, i32 0
  %553 = load i64, ptr %552, align 16
  %554 = getelementptr inbounds { i64, i64 }, ptr %51, i32 0, i32 1
  %555 = load i64, ptr %554, align 8
  %556 = call noundef { i64, i64 } @_Z7mod_mulnnn(i64 noundef %545, i64 noundef %547, i64 noundef %549, i64 noundef %551, i64 noundef %553, i64 noundef %555)
  %557 = getelementptr inbounds { i64, i64 }, ptr %52, i32 0, i32 0
  %558 = extractvalue { i64, i64 } %556, 0
  store i64 %558, ptr %557, align 16
  %559 = getelementptr inbounds { i64, i64 }, ptr %52, i32 0, i32 1
  %560 = extractvalue { i64, i64 } %556, 1
  store i64 %560, ptr %559, align 8
  %561 = load i128, ptr %52, align 16, !tbaa !5
  store i128 %561, ptr %35, align 16, !tbaa !5
  br label %562

562:                                              ; preds = %511
  %563 = load i32, ptr %44, align 4, !tbaa !9
  %564 = add nsw i32 %563, 1
  store i32 %564, ptr %44, align 4, !tbaa !9
  br label %506, !llvm.loop !29

565:                                              ; preds = %510
  call void @llvm.lifetime.start.p0(i64 16, ptr %53) #7
  %566 = load i128, ptr %34, align 16, !tbaa !5
  %567 = load i128, ptr %35, align 16, !tbaa !5
  %568 = add nsw i128 %566, %567
  %569 = load i128, ptr %5, align 16, !tbaa !5
  %570 = icmp slt i128 %568, %569
  br i1 %570, label %571, label %575

571:                                              ; preds = %565
  %572 = load i128, ptr %34, align 16, !tbaa !5
  %573 = load i128, ptr %35, align 16, !tbaa !5
  %574 = add nsw i128 %572, %573
  br label %581

575:                                              ; preds = %565
  %576 = load i128, ptr %34, align 16, !tbaa !5
  %577 = load i128, ptr %35, align 16, !tbaa !5
  %578 = add nsw i128 %576, %577
  %579 = load i128, ptr %5, align 16, !tbaa !5
  %580 = sub nsw i128 %578, %579
  br label %581

581:                                              ; preds = %575, %571
  %582 = phi i128 [ %574, %571 ], [ %580, %575 ]
  %583 = load i128, ptr %5, align 16, !tbaa !5
  store i128 %582, ptr %54, align 16, !tbaa !5
  %584 = getelementptr inbounds { i64, i64 }, ptr %54, i32 0, i32 0
  %585 = load i64, ptr %584, align 16
  %586 = getelementptr inbounds { i64, i64 }, ptr %54, i32 0, i32 1
  %587 = load i64, ptr %586, align 8
  store i128 %583, ptr %55, align 16, !tbaa !5
  %588 = getelementptr inbounds { i64, i64 }, ptr %55, i32 0, i32 0
  %589 = load i64, ptr %588, align 16
  %590 = getelementptr inbounds { i64, i64 }, ptr %55, i32 0, i32 1
  %591 = load i64, ptr %590, align 8
  %592 = call noundef { i64, i64 } @_ZSt5__gcdInET_S0_S0_(i64 noundef %585, i64 noundef %587, i64 noundef %589, i64 noundef %591)
  %593 = getelementptr inbounds { i64, i64 }, ptr %56, i32 0, i32 0
  %594 = extractvalue { i64, i64 } %592, 0
  store i64 %594, ptr %593, align 16
  %595 = getelementptr inbounds { i64, i64 }, ptr %56, i32 0, i32 1
  %596 = extractvalue { i64, i64 } %592, 1
  store i64 %596, ptr %595, align 8
  %597 = load i128, ptr %56, align 16, !tbaa !5
  store i128 %597, ptr %53, align 16, !tbaa !5
  %598 = load i128, ptr %53, align 16, !tbaa !5
  %599 = icmp slt i128 1, %598
  br i1 %599, label %600, label %606

600:                                              ; preds = %581
  %601 = load i128, ptr %53, align 16, !tbaa !5
  %602 = load i128, ptr %5, align 16, !tbaa !5
  %603 = icmp slt i128 %601, %602
  br i1 %603, label %604, label %606

604:                                              ; preds = %600
  %605 = load i128, ptr %53, align 16, !tbaa !5
  store i128 %605, ptr %3, align 16
  store i32 1, ptr %10, align 4
  br label %648

606:                                              ; preds = %600, %581
  call void @llvm.lifetime.start.p0(i64 16, ptr %57) #7
  %607 = load i128, ptr %34, align 16, !tbaa !5
  %608 = load i128, ptr %35, align 16, !tbaa !5
  %609 = sub nsw i128 %607, %608
  %610 = icmp slt i128 %609, 0
  br i1 %610, label %611, label %617

611:                                              ; preds = %606
  %612 = load i128, ptr %34, align 16, !tbaa !5
  %613 = load i128, ptr %35, align 16, !tbaa !5
  %614 = sub nsw i128 %612, %613
  %615 = load i128, ptr %5, align 16, !tbaa !5
  %616 = add nsw i128 %614, %615
  br label %621

617:                                              ; preds = %606
  %618 = load i128, ptr %34, align 16, !tbaa !5
  %619 = load i128, ptr %35, align 16, !tbaa !5
  %620 = sub nsw i128 %618, %619
  br label %621

621:                                              ; preds = %617, %611
  %622 = phi i128 [ %616, %611 ], [ %620, %617 ]
  %623 = load i128, ptr %5, align 16, !tbaa !5
  store i128 %622, ptr %58, align 16, !tbaa !5
  %624 = getelementptr inbounds { i64, i64 }, ptr %58, i32 0, i32 0
  %625 = load i64, ptr %624, align 16
  %626 = getelementptr inbounds { i64, i64 }, ptr %58, i32 0, i32 1
  %627 = load i64, ptr %626, align 8
  store i128 %623, ptr %59, align 16, !tbaa !5
  %628 = getelementptr inbounds { i64, i64 }, ptr %59, i32 0, i32 0
  %629 = load i64, ptr %628, align 16
  %630 = getelementptr inbounds { i64, i64 }, ptr %59, i32 0, i32 1
  %631 = load i64, ptr %630, align 8
  %632 = call noundef { i64, i64 } @_ZSt5__gcdInET_S0_S0_(i64 noundef %625, i64 noundef %627, i64 noundef %629, i64 noundef %631)
  %633 = getelementptr inbounds { i64, i64 }, ptr %60, i32 0, i32 0
  %634 = extractvalue { i64, i64 } %632, 0
  store i64 %634, ptr %633, align 16
  %635 = getelementptr inbounds { i64, i64 }, ptr %60, i32 0, i32 1
  %636 = extractvalue { i64, i64 } %632, 1
  store i64 %636, ptr %635, align 8
  %637 = load i128, ptr %60, align 16, !tbaa !5
  store i128 %637, ptr %57, align 16, !tbaa !5
  %638 = load i128, ptr %57, align 16, !tbaa !5
  %639 = icmp slt i128 1, %638
  br i1 %639, label %640, label %646

640:                                              ; preds = %621
  %641 = load i128, ptr %57, align 16, !tbaa !5
  %642 = load i128, ptr %5, align 16, !tbaa !5
  %643 = icmp slt i128 %641, %642
  br i1 %643, label %644, label %646

644:                                              ; preds = %640
  %645 = load i128, ptr %57, align 16, !tbaa !5
  store i128 %645, ptr %3, align 16
  store i32 1, ptr %10, align 4
  br label %647

646:                                              ; preds = %640, %621
  store i32 0, ptr %10, align 4
  br label %647

647:                                              ; preds = %646, %644
  call void @llvm.lifetime.end.p0(i64 16, ptr %57) #7
  br label %648

648:                                              ; preds = %647, %604
  call void @llvm.lifetime.end.p0(i64 16, ptr %53) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #7
  %649 = load i32, ptr %10, align 4
  switch i32 %649, label %654 [
    i32 0, label %650
  ]

650:                                              ; preds = %648
  br label %651

651:                                              ; preds = %650
  %652 = load i32, ptr %33, align 4, !tbaa !9
  %653 = add nsw i32 %652, 1
  store i32 %653, ptr %33, align 4, !tbaa !9
  br label %435, !llvm.loop !30

654:                                              ; preds = %648, %439
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  %655 = load i32, ptr %10, align 4
  switch i32 %655, label %658 [
    i32 35, label %656
  ]

656:                                              ; preds = %654
  %657 = load i128, ptr %5, align 16, !tbaa !5
  store i128 %657, ptr %3, align 16
  store i32 1, ptr %10, align 4
  br label %658

658:                                              ; preds = %656, %654
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  %659 = load { i64, i64 }, ptr %3, align 16
  ret { i64, i64 } %659

660:                                              ; preds = %297
  %661 = load ptr, ptr %22, align 8
  %662 = load i32, ptr %23, align 4
  %663 = insertvalue { ptr, i32 } poison, ptr %661, 0
  %664 = insertvalue { ptr, i32 } %663, i32 %662, 1
  resume { ptr, i32 } %664

665:                                              ; preds = %427
  unreachable
}

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<2001>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(256), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EE3setEmb(ptr noundef nonnull align 8 dereferenceable(264), i64 noundef, i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt6bitsetILm2001EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(256)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt6bitsetILm2051EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(264)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(256) ptr @_ZNSt6bitsetILm2001EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(256)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(264)) #1 align 2

; 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 void @_ZNSt6bitsetILm2051EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<2051>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(264), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm2051EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm2051EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef { i64, i64 } @_ZSt5__gcdInET_S0_S0_(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"__int128", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}


; 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::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [32 x i64] }
%"class.std::bitset.0" = type { %"struct.std::_Base_bitset.1" }
%"struct.std::_Base_bitset.1" = type { [33 x i64] }
%"class.std::bitset<2001>::reference" = type { ptr, i64 }
%"class.std::bitset<2051>::reference" = type { ptr, i64 }

@ptot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [50001 x i32], align 16
@qtot = external dso_local local_unnamed_addr global i32, align 4
@qr = external dso_local local_unnamed_addr global [2001 x i32], align 16
@stot = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [15000001 x double], align 16
@num = external dso_local local_unnamed_addr global [2051 x i64], align 16
@msk = external dso_local global [2051 x %"class.std::bitset"], align 16
@ex = external dso_local global [2051 x %"class.std::bitset"], align 16
@sel = external dso_local global [2051 x %"class.std::bitset.0"], align 16
@_ZZ15quadratic_sievenE3cnt = external hidden local_unnamed_addr global [2001 x i32], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef { i64, i64 } @_Z7mod_mulnnn(i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef { i64, i64 } @_Z7mod_pownnn(i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef { i64, i64 } @_Z15quadratic_sieven(i64 noundef %0, i64 noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::bitset<2001>::reference", align 8
  %4 = alloca %"class.std::bitset<2001>::reference", align 8
  %5 = alloca %"class.std::bitset<2001>::reference", align 8
  %6 = alloca %"class.std::bitset<2001>::reference", align 8
  %7 = alloca %"class.std::bitset<2051>::reference", align 8
  %8 = alloca %"class.std::bitset<2001>::reference", align 8
  %.sroa.2176.0.insert.ext = zext i64 %1 to i128
  %.sroa.2176.0.insert.shift = shl nuw i128 %.sroa.2176.0.insert.ext, 64
  %.sroa.0175.0.insert.ext = zext i64 %0 to i128
  %.sroa.0175.0.insert.insert = or disjoint i128 %.sroa.2176.0.insert.shift, %.sroa.0175.0.insert.ext
  store i32 0, ptr @qtot, align 4, !tbaa !5
  %9 = load i32, ptr @ptot, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %32, %2
  %11 = sitofp i128 %.sroa.0175.0.insert.insert to double
  %12 = tail call double @sqrt(double noundef %11) #7
  %13 = fptosi double %12 to i64
  br label %39

.lr.ph:                                           ; preds = %2, %32
  %14 = phi i32 [ %33, %32 ], [ 0, %2 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ 0, %2 ]
  %15 = getelementptr inbounds [50001 x i32], ptr @pr, i64 0, i64 %indvars.iv
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp eq i32 %16, 2
  br i1 %17, label %26, label %18

18:                                               ; preds = %.lr.ph
  %19 = sext i32 %16 to i128
  %20 = srem i128 %.sroa.0175.0.insert.insert, %19
  %21 = trunc nsw i128 %20 to i32
  %22 = add nsw i32 %16, -1
  %23 = ashr i32 %22, 1
  %24 = tail call noundef i32 @_Z7mod_powiii(i32 noundef %21, i32 noundef %23, i32 noundef %16)
  %25 = icmp eq i32 %24, 1
  %.pre353 = load i32, ptr @qtot, align 4
  br i1 %25, label %._crit_edge351, label %32

._crit_edge351:                                   ; preds = %18
  %.pre = load i32, ptr %15, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %._crit_edge351, %.lr.ph
  %27 = phi i32 [ %.pre353, %._crit_edge351 ], [ %14, %.lr.ph ]
  %28 = phi i32 [ %.pre, %._crit_edge351 ], [ 2, %.lr.ph ]
  %29 = add nsw i32 %27, 1
  store i32 %29, ptr @qtot, align 4, !tbaa !5
  %30 = sext i32 %27 to i64
  %31 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %30
  store i32 %28, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %18, %26
  %33 = phi i32 [ %.pre353, %18 ], [ %29, %26 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr @ptot, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  %37 = icmp slt i32 %33, 2001
  %38 = select i1 %36, i1 %37, i1 false
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !9

39:                                               ; preds = %39, %._crit_edge
  %.0184 = phi i64 [ %13, %._crit_edge ], [ %42, %39 ]
  %40 = sext i64 %.0184 to i128
  %41 = mul nsw i128 %40, %40
  %.not = icmp sgt i128 %41, %.sroa.0175.0.insert.insert
  %42 = add nsw i64 %.0184, 1
  br i1 %.not, label %43, label %39, !llvm.loop !11

43:                                               ; preds = %39
  %44 = sub nsw i128 %41, %.sroa.0175.0.insert.insert
  %45 = sitofp i128 %44 to double
  store double %45, ptr @seq, align 16, !tbaa !12
  br label %48

.preheader248:                                    ; preds = %48
  %46 = load i32, ptr @qtot, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph261.preheader, label %.lr.ph271.preheader

.lr.ph261.preheader:                              ; preds = %.preheader248
  %wide.trip.count322 = zext nneg i32 %46 to i64
  br label %.lr.ph261

48:                                               ; preds = %56, %43
  %49 = phi double [ %45, %43 ], [ %61, %56 ]
  %indvars.iv309 = phi i64 [ 0, %43 ], [ %indvars.iv.next310.1, %56 ]
  %50 = add nsw i64 %.0184, %indvars.iv309
  %51 = shl i64 %50, 1
  %52 = or disjoint i64 %51, 1
  %53 = sitofp i64 %52 to double
  %54 = fadd double %49, %53
  %indvars.iv.next310 = or disjoint i64 %indvars.iv309, 1
  %55 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %indvars.iv.next310
  store double %54, ptr %55, align 8, !tbaa !12
  %exitcond.not = icmp eq i64 %indvars.iv309, 15000000
  br i1 %exitcond.not, label %.preheader248, label %56, !llvm.loop !14

56:                                               ; preds = %48
  %57 = add nsw i64 %.0184, %indvars.iv.next310
  %58 = shl i64 %57, 1
  %59 = or disjoint i64 %58, 1
  %60 = sitofp i64 %59 to double
  %61 = fadd double %54, %60
  %indvars.iv.next310.1 = add nuw nsw i64 %indvars.iv309, 2
  %62 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %indvars.iv.next310.1
  store double %61, ptr %62, align 16, !tbaa !12
  br label %48

.lr.ph271.preheader:                              ; preds = %._crit_edge259, %.preheader248
  store i32 0, ptr @stot, align 4, !tbaa !5
  br label %.lr.ph271

.lr.ph261:                                        ; preds = %.lr.ph261.preheader, %._crit_edge259
  %indvars.iv319 = phi i64 [ 0, %.lr.ph261.preheader ], [ %indvars.iv.next320, %._crit_edge259 ]
  %63 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %indvars.iv319
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = srem i64 %.0184, %65
  %67 = trunc nsw i64 %66 to i32
  %68 = icmp sgt i32 %64, 0
  br i1 %68, label %.lr.ph258, label %._crit_edge259

.lr.ph258:                                        ; preds = %.lr.ph261
  %69 = zext nneg i32 %64 to i128
  %70 = srem i128 %44, %69
  %71 = trunc nsw i128 %70 to i32
  %72 = uitofp nneg i32 %64 to double
  %73 = zext nneg i32 %64 to i64
  br label %74

._crit_edge259:                                   ; preds = %.loopexit247, %.lr.ph261
  %indvars.iv.next320 = add nuw nsw i64 %indvars.iv319, 1
  %exitcond323.not = icmp eq i64 %indvars.iv.next320, %wide.trip.count322
  br i1 %exitcond323.not, label %.lr.ph271.preheader, label %.lr.ph261, !llvm.loop !15

74:                                               ; preds = %.lr.ph258, %.loopexit247
  %indvars.iv312 = phi i64 [ 0, %.lr.ph258 ], [ %indvars.iv.next313, %.loopexit247 ]
  %.0188256 = phi i32 [ %71, %.lr.ph258 ], [ %85, %.loopexit247 ]
  %indvars317 = trunc i64 %indvars.iv312 to i32
  %.not232 = icmp eq i32 %.0188256, 0
  %75 = icmp ult i32 %indvars317, 15000001
  %or.cond305 = and i1 %.not232, %75
  br i1 %or.cond305, label %.lr.ph253, label %.loopexit247

.lr.ph253:                                        ; preds = %74, %.lr.ph253
  %indvars.iv314 = phi i64 [ %indvars.iv.next315, %.lr.ph253 ], [ %indvars.iv312, %74 ]
  %76 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %indvars.iv314
  %77 = load double, ptr %76, align 8, !tbaa !12
  %78 = fdiv double %77, %72
  store double %78, ptr %76, align 8, !tbaa !12
  %indvars.iv.next315 = add nuw nsw i64 %indvars.iv314, %73
  %79 = trunc nuw i64 %indvars.iv.next315 to i32
  %80 = icmp slt i32 %79, 15000001
  br i1 %80, label %.lr.ph253, label %.loopexit247, !llvm.loop !16

.loopexit247:                                     ; preds = %.lr.ph253, %74
  %81 = add nsw i32 %indvars317, %67
  %82 = shl i32 %81, 1
  %83 = add i32 %.0188256, 1
  %84 = add i32 %83, %82
  %85 = srem i32 %84, %64
  %indvars.iv.next313 = add nuw nsw i64 %indvars.iv312, 1
  %exitcond318.not = icmp eq i64 %indvars.iv.next313, %73
  br i1 %exitcond318.not, label %._crit_edge259, label %74, !llvm.loop !17

.preheader244:                                    ; preds = %130
  %.pre356 = load i32, ptr @qtot, align 4, !tbaa !5
  %86 = icmp sgt i32 %.pre356, 0
  br i1 %86, label %.preheader243, label %.preheader242

.lr.ph271:                                        ; preds = %.lr.ph271.preheader, %130
  %87 = phi i32 [ 0, %.lr.ph271.preheader ], [ %131, %130 ]
  %indvars.iv327 = phi i64 [ 0, %.lr.ph271.preheader ], [ %indvars.iv.next328, %130 ]
  %.0191268 = phi i128 [ %44, %.lr.ph271.preheader ], [ %135, %130 ]
  %88 = getelementptr inbounds [15000001 x double], ptr @seq, i64 0, i64 %indvars.iv327
  %89 = load double, ptr %88, align 8, !tbaa !12
  %90 = fadd double %89, -1.000000e+00
  %91 = call double @llvm.fabs.f64(double %90)
  %92 = fcmp ugt double %91, 1.000000e-09
  br i1 %92, label %.lr.ph271._crit_edge, label %.preheader245

.lr.ph271._crit_edge:                             ; preds = %.lr.ph271
  %.pre358 = add nsw i64 %.0184, %indvars.iv327
  br label %130

.preheader245:                                    ; preds = %.lr.ph271
  %93 = load i32, ptr @qtot, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %.lr.ph265, label %._crit_edge266

._crit_edge266.loopexit:                          ; preds = %126
  %.pre355 = load i32, ptr @stot, align 4, !tbaa !5
  br label %._crit_edge266

._crit_edge266:                                   ; preds = %._crit_edge266.loopexit, %.preheader245
  %95 = phi i32 [ %.pre355, %._crit_edge266.loopexit ], [ %87, %.preheader245 ]
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %96
  %98 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EE5resetEv(ptr noundef nonnull align 8 dereferenceable(264) %97) #7
  %99 = load i32, ptr @stot, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %100
  %102 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EE3setEmb(ptr noundef nonnull align 8 dereferenceable(264) %101, i64 noundef %100, i1 noundef zeroext true)
  %103 = add nsw i64 %.0184, %indvars.iv327
  %104 = load i32, ptr @stot, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @stot, align 4, !tbaa !5
  %106 = sext i32 %104 to i64
  %107 = getelementptr inbounds [2051 x i64], ptr @num, i64 0, i64 %106
  store i64 %103, ptr %107, align 8, !tbaa !18
  br label %130

.lr.ph265:                                        ; preds = %.preheader245, %126
  %108 = phi i32 [ %127, %126 ], [ %93, %.preheader245 ]
  %indvars.iv324 = phi i64 [ %indvars.iv.next325, %126 ], [ 0, %.preheader245 ]
  %.0193264 = phi i128 [ %.1194, %126 ], [ %.0191268, %.preheader245 ]
  %109 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %indvars.iv324
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i128
  %112 = srem i128 %.0193264, %111
  %113 = icmp eq i128 %112, 0
  br i1 %113, label %114, label %126

114:                                              ; preds = %.lr.ph265
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %115 = load i32, ptr @stot, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %116
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<2001>::reference") align 8 %3, ptr noundef nonnull align 8 dereferenceable(256) %117, i64 noundef %indvars.iv324)
  %118 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %3, i1 noundef zeroext true) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %119 = load i32, ptr @stot, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @ex, i64 0, i64 %120
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<2001>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(256) %121, i64 noundef %indvars.iv324)
  %122 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %118) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %123 = load i32, ptr %109, align 4, !tbaa !5
  %124 = sext i32 %123 to i128
  %125 = sdiv i128 %.0193264, %124
  %.pre354 = load i32, ptr @qtot, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %.lr.ph265, %114
  %127 = phi i32 [ %.pre354, %114 ], [ %108, %.lr.ph265 ]
  %.1194 = phi i128 [ %125, %114 ], [ %.0193264, %.lr.ph265 ]
  %indvars.iv.next325 = add nuw nsw i64 %indvars.iv324, 1
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next325, %128
  br i1 %129, label %.lr.ph265, label %._crit_edge266.loopexit, !llvm.loop !20

130:                                              ; preds = %.lr.ph271._crit_edge, %._crit_edge266
  %.pre-phi = phi i64 [ %.pre358, %.lr.ph271._crit_edge ], [ %103, %._crit_edge266 ]
  %131 = phi i32 [ %87, %.lr.ph271._crit_edge ], [ %105, %._crit_edge266 ]
  %132 = shl i64 %.pre-phi, 1
  %133 = or disjoint i64 %132, 1
  %134 = sext i64 %133 to i128
  %135 = add nsw i128 %.0191268, %134
  %indvars.iv.next328 = add nuw nsw i64 %indvars.iv327, 1
  %136 = icmp ult i64 %indvars.iv327, 15000000
  %137 = icmp slt i32 %131, 2051
  %138 = select i1 %136, i1 %137, i1 false
  br i1 %138, label %.lr.ph271, label %.preheader244, !llvm.loop !21

.preheader243:                                    ; preds = %.preheader244, %.thread
  %indvars.iv336 = phi i64 [ %indvars.iv.next337, %.thread ], [ 0, %.preheader244 ]
  %.0196280 = phi i32 [ %.1197, %.thread ], [ 0, %.preheader244 ]
  %139 = load i32, ptr @stot, align 4, !tbaa !5
  %140 = icmp slt i32 %.0196280, %139
  br i1 %140, label %.lr.ph273, label %.thread

.lr.ph273:                                        ; preds = %.preheader243
  %141 = sext i32 %.0196280 to i64
  br label %144

.preheader242.loopexit:                           ; preds = %.thread
  %.pre357 = load i32, ptr @stot, align 4, !tbaa !5
  br label %.preheader242

.preheader242:                                    ; preds = %.preheader242.loopexit, %.preheader244
  %142 = phi i32 [ %131, %.preheader244 ], [ %.pre357, %.preheader242.loopexit ]
  %.0196.lcssa = phi i32 [ 0, %.preheader244 ], [ %.1197, %.preheader242.loopexit ]
  %.not230294 = icmp slt i32 %.0196.lcssa, %142
  br i1 %.not230294, label %.lr.ph296.preheader, label %.thread237

.lr.ph296.preheader:                              ; preds = %.preheader242
  %143 = sext i32 %.0196.lcssa to i64
  br label %.lr.ph296

144:                                              ; preds = %.lr.ph273, %147
  %indvars.iv330 = phi i64 [ %141, %.lr.ph273 ], [ %indvars.iv.next331, %147 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %145 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %indvars.iv330
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<2001>::reference") align 8 %5, ptr noundef nonnull align 8 dereferenceable(256) %145, i64 noundef %indvars.iv336)
  %146 = call noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  br i1 %146, label %151, label %147

147:                                              ; preds = %144
  %indvars.iv.next331 = add nsw i64 %indvars.iv330, 1
  %148 = load i32, ptr @stot, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = icmp slt i64 %indvars.iv.next331, %149
  br i1 %150, label %144, label %.thread, !llvm.loop !22

151:                                              ; preds = %144
  %152 = icmp eq i64 %indvars.iv330, -1
  br i1 %152, label %.thread, label %153

153:                                              ; preds = %151
  %154 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %141
  %sext = shl i64 %indvars.iv330, 32
  %155 = ashr exact i64 %sext, 32
  %156 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %155
  call void @_ZSt4swapISt6bitsetILm2001EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(256) %154, ptr noundef nonnull align 8 dereferenceable(256) %156) #7
  %157 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %141
  %158 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %155
  call void @_ZSt4swapISt6bitsetILm2051EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(264) %157, ptr noundef nonnull align 8 dereferenceable(264) %158) #7
  %159 = load i32, ptr @stot, align 4, !tbaa !5
  %160 = icmp sgt i32 %159, 0
  br i1 %160, label %.lr.ph276, label %._crit_edge277

.lr.ph276:                                        ; preds = %153
  %161 = zext i32 %.0196280 to i64
  br label %163

._crit_edge277:                                   ; preds = %.critedge.thread, %153
  %162 = add nsw i32 %.0196280, 1
  br label %.thread

163:                                              ; preds = %.lr.ph276, %.critedge.thread
  %indvars.iv333 = phi i64 [ 0, %.lr.ph276 ], [ %indvars.iv.next334, %.critedge.thread ]
  %.not231.not = icmp eq i64 %indvars.iv333, %161
  br i1 %.not231.not, label %.critedge.thread, label %.critedge

.critedge:                                        ; preds = %163
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %164 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @msk, i64 0, i64 %indvars.iv333
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<2001>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(256) %164, i64 noundef %indvars.iv336)
  %165 = call noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br i1 %165, label %166, label %.critedge.thread

166:                                              ; preds = %.critedge
  %167 = call noundef nonnull align 8 dereferenceable(256) ptr @_ZNSt6bitsetILm2001EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(256) %164, ptr noundef nonnull align 8 dereferenceable(256) %154) #7
  %168 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %indvars.iv333
  %169 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(264) %168, ptr noundef nonnull align 8 dereferenceable(264) %157) #7
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %163, %.critedge, %166
  %indvars.iv.next334 = add nuw nsw i64 %indvars.iv333, 1
  %170 = load i32, ptr @stot, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = icmp slt i64 %indvars.iv.next334, %171
  br i1 %172, label %163, label %._crit_edge277, !llvm.loop !23

.thread:                                          ; preds = %147, %.preheader243, %151, %._crit_edge277
  %.1197 = phi i32 [ %162, %._crit_edge277 ], [ %.0196280, %151 ], [ %.0196280, %.preheader243 ], [ %.0196280, %147 ]
  %indvars.iv.next337 = add nuw nsw i64 %indvars.iv336, 1
  %173 = load i32, ptr @qtot, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = icmp slt i64 %indvars.iv.next337, %174
  br i1 %175, label %.preheader243, label %.preheader242.loopexit, !llvm.loop !24

176:                                              ; preds = %232
  %indvars.iv.next349 = add nsw i64 %indvars.iv348, 1
  %177 = load i32, ptr @stot, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %.not230 = icmp slt i64 %indvars.iv.next349, %178
  br i1 %.not230, label %.lr.ph296, label %.thread237, !llvm.loop !25

.lr.ph296:                                        ; preds = %.lr.ph296.preheader, %176
  %179 = phi i32 [ %142, %.lr.ph296.preheader ], [ %177, %176 ]
  %indvars.iv348 = phi i64 [ %143, %.lr.ph296.preheader ], [ %indvars.iv.next349, %176 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8004) @_ZZ15quadratic_sievenE3cnt, i8 0, i64 8004, i1 false)
  %180 = icmp sgt i32 %179, 0
  br i1 %180, label %.lr.ph287, label %.preheader

.lr.ph287:                                        ; preds = %.lr.ph296
  %181 = getelementptr inbounds [2051 x %"class.std::bitset.0"], ptr @sel, i64 0, i64 %indvars.iv348
  br label %184

.preheader:                                       ; preds = %.loopexit, %.lr.ph296
  %.0205.lcssa = phi i128 [ 1, %.lr.ph296 ], [ %.1206, %.loopexit ]
  %182 = load i32, ptr @qtot, align 4, !tbaa !5
  %183 = icmp sgt i32 %182, 0
  br i1 %183, label %.lr.ph291, label %._crit_edge292

184:                                              ; preds = %.lr.ph287, %.loopexit
  %indvars.iv342 = phi i64 [ 0, %.lr.ph287 ], [ %indvars.iv.next343, %.loopexit ]
  %.0205285 = phi i128 [ 1, %.lr.ph287 ], [ %.1206, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt6bitsetILm2051EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<2051>::reference") align 8 %7, ptr noundef nonnull align 8 dereferenceable(264) %181, i64 noundef %indvars.iv342)
  %185 = call noundef zeroext i1 @_ZNKSt6bitsetILm2051EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @_ZNSt6bitsetILm2051EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br i1 %185, label %186, label %.loopexit

186:                                              ; preds = %184
  %187 = getelementptr inbounds [2051 x i64], ptr @num, i64 0, i64 %indvars.iv342
  %188 = load i64, ptr %187, align 8, !tbaa !18
  %.sroa.047.0.extract.trunc = trunc i128 %.0205285 to i64
  %.sroa.248.0.extract.shift = lshr i128 %.0205285, 64
  %.sroa.248.0.extract.trunc = trunc nuw i128 %.sroa.248.0.extract.shift to i64
  %189 = ashr i64 %188, 63
  %190 = call noundef { i64, i64 } @_Z7mod_mulnnn(i64 noundef %.sroa.047.0.extract.trunc, i64 noundef %.sroa.248.0.extract.trunc, i64 noundef %188, i64 noundef %189, i64 noundef %0, i64 noundef %1)
  %191 = extractvalue { i64, i64 } %190, 0
  %192 = extractvalue { i64, i64 } %190, 1
  %.sroa.242.0.insert.ext = zext i64 %192 to i128
  %.sroa.242.0.insert.shift = shl nuw i128 %.sroa.242.0.insert.ext, 64
  %.sroa.041.0.insert.ext = zext i64 %191 to i128
  %.sroa.041.0.insert.insert = or disjoint i128 %.sroa.242.0.insert.shift, %.sroa.041.0.insert.ext
  %193 = load i32, ptr @qtot, align 4, !tbaa !5
  %194 = icmp sgt i32 %193, 0
  br i1 %194, label %.lr.ph283, label %.loopexit

.lr.ph283:                                        ; preds = %186
  %195 = getelementptr inbounds [2051 x %"class.std::bitset"], ptr @ex, i64 0, i64 %indvars.iv342
  br label %196

196:                                              ; preds = %.lr.ph283, %196
  %indvars.iv339 = phi i64 [ 0, %.lr.ph283 ], [ %indvars.iv.next340, %196 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<2001>::reference") align 8 %8, ptr noundef nonnull align 8 dereferenceable(256) %195, i64 noundef %indvars.iv339)
  %197 = call noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  %198 = zext i1 %197 to i32
  %199 = getelementptr inbounds [2001 x i32], ptr @_ZZ15quadratic_sievenE3cnt, i64 0, i64 %indvars.iv339
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = add nsw i32 %200, %198
  store i32 %201, ptr %199, align 4, !tbaa !5
  call void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  %indvars.iv.next340 = add nuw nsw i64 %indvars.iv339, 1
  %202 = load i32, ptr @qtot, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = icmp slt i64 %indvars.iv.next340, %203
  br i1 %204, label %196, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %196, %186, %184
  %.1206 = phi i128 [ %.0205285, %184 ], [ %.sroa.041.0.insert.insert, %186 ], [ %.sroa.041.0.insert.insert, %196 ]
  %indvars.iv.next343 = add nuw nsw i64 %indvars.iv342, 1
  %205 = load i32, ptr @stot, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = icmp slt i64 %indvars.iv.next343, %206
  br i1 %207, label %184, label %.preheader, !llvm.loop !27

._crit_edge292.loopexit:                          ; preds = %.lr.ph291
  %.sroa.218.0.insert.ext = zext i64 %228 to i128
  %.sroa.218.0.insert.shift = shl nuw i128 %.sroa.218.0.insert.ext, 64
  %.sroa.017.0.insert.ext = zext i64 %227 to i128
  %.sroa.017.0.insert.insert = or disjoint i128 %.sroa.218.0.insert.shift, %.sroa.017.0.insert.ext
  br label %._crit_edge292

._crit_edge292:                                   ; preds = %._crit_edge292.loopexit, %.preheader
  %.0207.lcssa = phi i128 [ 1, %.preheader ], [ %.sroa.017.0.insert.insert, %._crit_edge292.loopexit ]
  %208 = add nsw i128 %.0207.lcssa, %.0205.lcssa
  %209 = icmp slt i128 %208, %.sroa.0175.0.insert.insert
  %210 = select i1 %209, i128 0, i128 %.sroa.0175.0.insert.insert
  %.off0.v = sub nsw i128 %208, %210
  %.off0 = trunc i128 %.off0.v to i64
  %.off64.v = lshr i128 %.off0.v, 64
  %.off64 = trunc nuw i128 %.off64.v to i64
  %211 = call noundef { i64, i64 } @_ZSt5__gcdInET_S0_S0_(i64 noundef %.off0, i64 noundef %.off64, i64 noundef %0, i64 noundef %1)
  %212 = extractvalue { i64, i64 } %211, 0
  %213 = extractvalue { i64, i64 } %211, 1
  %.sroa.29.0.insert.ext = zext i64 %213 to i128
  %.sroa.29.0.insert.shift = shl nuw i128 %.sroa.29.0.insert.ext, 64
  %.sroa.08.0.insert.ext = zext i64 %212 to i128
  %.sroa.08.0.insert.insert = or disjoint i128 %.sroa.29.0.insert.shift, %.sroa.08.0.insert.ext
  %214 = icmp sgt i128 %.sroa.08.0.insert.insert, 1
  %215 = icmp slt i128 %.sroa.08.0.insert.insert, %.sroa.0175.0.insert.insert
  %or.cond = select i1 %214, i1 %215, i1 false
  br i1 %or.cond, label %.thread237, label %232

.lr.ph291:                                        ; preds = %.preheader, %.lr.ph291
  %indvars.iv345 = phi i64 [ %indvars.iv.next346, %.lr.ph291 ], [ 0, %.preheader ]
  %.0207290.off0 = phi i64 [ %227, %.lr.ph291 ], [ 1, %.preheader ]
  %.0207290.off64 = phi i64 [ %228, %.lr.ph291 ], [ 0, %.preheader ]
  %216 = getelementptr inbounds [2001 x i32], ptr @qr, i64 0, i64 %indvars.iv345
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = getelementptr inbounds [2001 x i32], ptr @_ZZ15quadratic_sievenE3cnt, i64 0, i64 %indvars.iv345
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = ashr i32 %219, 1
  %.sroa.031.0.extract.trunc = sext i32 %217 to i64
  %221 = ashr i32 %217, 31
  %.sroa.232.0.extract.trunc = sext i32 %221 to i64
  %.sroa.029.0.extract.trunc = sext i32 %220 to i64
  %222 = ashr i32 %219, 31
  %.sroa.230.0.extract.trunc = sext i32 %222 to i64
  %223 = call noundef { i64, i64 } @_Z7mod_pownnn(i64 noundef %.sroa.031.0.extract.trunc, i64 noundef %.sroa.232.0.extract.trunc, i64 noundef %.sroa.029.0.extract.trunc, i64 noundef %.sroa.230.0.extract.trunc, i64 noundef %0, i64 noundef %1)
  %224 = extractvalue { i64, i64 } %223, 0
  %225 = extractvalue { i64, i64 } %223, 1
  %226 = call noundef { i64, i64 } @_Z7mod_mulnnn(i64 noundef %.0207290.off0, i64 noundef %.0207290.off64, i64 noundef %224, i64 noundef %225, i64 noundef %0, i64 noundef %1)
  %227 = extractvalue { i64, i64 } %226, 0
  %228 = extractvalue { i64, i64 } %226, 1
  %indvars.iv.next346 = add nuw nsw i64 %indvars.iv345, 1
  %229 = load i32, ptr @qtot, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = icmp slt i64 %indvars.iv.next346, %230
  br i1 %231, label %.lr.ph291, label %._crit_edge292.loopexit, !llvm.loop !28

232:                                              ; preds = %._crit_edge292
  %233 = sub nsw i128 %.0205.lcssa, %.0207.lcssa
  %234 = icmp slt i128 %233, 0
  %235 = select i1 %234, i128 %.sroa.0175.0.insert.insert, i128 0
  %.off0222.v = add nsw i128 %233, %235
  %.off0222 = trunc i128 %.off0222.v to i64
  %.off64225.v = lshr i128 %.off0222.v, 64
  %.off64225 = trunc nuw i128 %.off64225.v to i64
  %236 = call noundef { i64, i64 } @_ZSt5__gcdInET_S0_S0_(i64 noundef %.off0222, i64 noundef %.off64225, i64 noundef %0, i64 noundef %1)
  %237 = extractvalue { i64, i64 } %236, 0
  %238 = extractvalue { i64, i64 } %236, 1
  %.sroa.2.0.insert.ext = zext i64 %238 to i128
  %.sroa.2.0.insert.shift = shl nuw i128 %.sroa.2.0.insert.ext, 64
  %.sroa.0.0.insert.ext = zext i64 %237 to i128
  %.sroa.0.0.insert.insert = or disjoint i128 %.sroa.2.0.insert.shift, %.sroa.0.0.insert.ext
  %239 = icmp sgt i128 %.sroa.0.0.insert.insert, 1
  %240 = icmp slt i128 %.sroa.0.0.insert.insert, %.sroa.0175.0.insert.insert
  %or.cond233 = select i1 %239, i1 %240, i1 false
  br i1 %or.cond233, label %.thread237, label %176

.thread237:                                       ; preds = %176, %._crit_edge292, %232, %.preheader242
  %spec.select234 = phi i64 [ %1, %.preheader242 ], [ %238, %232 ], [ %213, %._crit_edge292 ], [ %1, %176 ]
  %spec.select = phi i64 [ %0, %.preheader242 ], [ %237, %232 ], [ %212, %._crit_edge292 ], [ %0, %176 ]
  %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %spec.select, 0
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %spec.select234, 1
  ret { i64, i64 } %.fca.1.insert
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm2001EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<2001>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(256), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm2001EE9referenceaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm2001EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EE3setEmb(ptr noundef nonnull align 8 dereferenceable(264), i64 noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm2001EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt6bitsetILm2001EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt6bitsetILm2051EEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(256) ptr @_ZNSt6bitsetILm2001EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(264) ptr @_ZNSt6bitsetILm2051EEeOERKS0_(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #1 align 2

; 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 void @_ZNSt6bitsetILm2051EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<2051>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(264), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm2051EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm2051EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef { i64, i64 } @_ZSt5__gcdInET_S0_S0_(i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

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

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

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


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