; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/NUMSET (brute)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@smallerThanRoot = external dso_local global i32, align 4
@primesCount = external dso_local global i32, align 4
@remap = external dso_local global [1010 x i32], align 16
@Next = external dso_local global [1010 x i32], align 16
@initial = external dso_local global %"class.std::vector", align 8
@variants = external dso_local global [1010 x %"class.std::vector"], align 16
@dp = external dso_local global [1010 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z19generateSmallPrimesv() #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @_Z19generateSmallPrimesv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %36

36:                                               ; preds = %387, %2
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %6, align 4, !tbaa !5
  %39 = icmp ne i32 %37, 0
  br i1 %39, label %40, label %391

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

41:                                               ; preds = %49, %40
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = icmp sle i32 %42, 1000
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %52

45:                                               ; preds = %41
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %47
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #7
  br label %49

49:                                               ; preds = %45
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %7, align 4, !tbaa !5
  br label %41, !llvm.loop !11

52:                                               ; preds = %44
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @initial) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %101, %52
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

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

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 2, ptr %13, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %86, %59
  %62 = load i32, ptr %13, align 4, !tbaa !5
  %63 = load i32, ptr %13, align 4, !tbaa !5
  %64 = mul nsw i32 %62, %63
  %65 = icmp sle i32 %64, 1000
  br i1 %65, label %67, label %66

66:                                               ; preds = %61
  store i32 10, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %89

67:                                               ; preds = %61
  br label %68

68:                                               ; preds = %73, %67
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = srem i32 %69, %70
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %85

73:                                               ; preds = %68
  %74 = load i32, ptr %13, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1010 x i32], ptr @remap, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  %79 = shl i32 1, %78
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = or i32 %80, %79
  store i32 %81, ptr %12, align 4, !tbaa !5
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = sdiv i32 %83, %82
  store i32 %84, ptr %11, align 4, !tbaa !5
  br label %68, !llvm.loop !13

85:                                               ; preds = %68
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %13, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %13, align 4, !tbaa !5
  br label %61, !llvm.loop !14

89:                                               ; preds = %66
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = icmp ne i32 %90, 1
  br i1 %91, label %92, label %99

92:                                               ; preds = %89
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1010 x i32], ptr @remap, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %97
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %98, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br label %100

99:                                               ; preds = %89
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @initial, ptr noundef nonnull align 4 dereferenceable(4) %12)
  br label %100

100:                                              ; preds = %99, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %9, align 4, !tbaa !5
  br label %54, !llvm.loop !15

104:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %151, %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = load i32, ptr @primesCount, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  %109 = icmp sle i32 %106, %108
  br i1 %109, label %111, label %110

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

111:                                              ; preds = %105
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %113
  %115 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #7
  %116 = icmp ugt i64 %115, 0
  br i1 %116, label %125, label %117

117:                                              ; preds = %111
  %118 = load i32, ptr %14, align 4, !tbaa !5
  %119 = load i32, ptr @primesCount, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  %121 = icmp eq i32 %118, %120
  br i1 %121, label %125, label %122

122:                                              ; preds = %117
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 1
  br i1 %124, label %125, label %146

125:                                              ; preds = %122, %117, %111
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %127
  %129 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %130 = shl i32 1, %129
  %131 = sext i32 %130 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %131)
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %133
  %135 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %134) #7
  %136 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %135, ptr %136, align 8
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %138
  %140 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %139) #7
  %141 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %140, ptr %141, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  %142 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8
  %144 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiEvT_S7_RKT0_(ptr %143, ptr %145, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %150

146:                                              ; preds = %122
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %148
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %149) #7
  br label %150

150:                                              ; preds = %146, %125
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %14, align 4, !tbaa !5
  br label %105, !llvm.loop !16

154:                                              ; preds = %110
  %155 = load i32, ptr @primesCount, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  %157 = load i32, ptr @primesCount, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %159
  store i32 %156, ptr %160, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %161 = load i32, ptr @primesCount, align 4, !tbaa !5
  store i32 %161, ptr %18, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %187, %154
  %163 = load i32, ptr %18, align 4, !tbaa !5
  %164 = icmp sge i32 %163, 1
  br i1 %164, label %166, label %165

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

166:                                              ; preds = %162
  %167 = load i32, ptr %18, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %168
  %170 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %169) #7
  %171 = icmp ne i64 %170, 0
  br i1 %171, label %172, label %177

172:                                              ; preds = %166
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = load i32, ptr %18, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %175
  store i32 %173, ptr %176, align 4, !tbaa !5
  br label %186

177:                                              ; preds = %166
  %178 = load i32, ptr %18, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = load i32, ptr %18, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %184
  store i32 %182, ptr %185, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %177, %172
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %18, align 4, !tbaa !5
  %189 = add nsw i32 %188, -1
  store i32 %189, ptr %18, align 4, !tbaa !5
  br label %162, !llvm.loop !17

190:                                              ; preds = %165
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([1010 x %"class.std::vector"], ptr @dp, i64 0, i64 1), i64 noundef 0) #7
  store i32 0, ptr %191, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store ptr @initial, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %192 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @initial) #7
  %193 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %192, ptr %193, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %194 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @initial) #7
  %195 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %194, ptr %195, align 8
  br label %196

196:                                              ; preds = %236, %190
  %197 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %197, label %199, label %198

198:                                              ; preds = %196
  store i32 21, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %238

199:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %200 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %201 = load i32, ptr %200, align 4, !tbaa !5
  store i32 %201, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %232, %199
  %203 = load i32, ptr %23, align 4, !tbaa !5
  %204 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %205 = shl i32 1, %204
  %206 = icmp slt i32 %203, %205
  br i1 %206, label %208, label %207

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

208:                                              ; preds = %202
  %209 = load i32, ptr %23, align 4, !tbaa !5
  %210 = load i32, ptr %22, align 4, !tbaa !5
  %211 = and i32 %209, %210
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %231

213:                                              ; preds = %208
  %214 = load i32, ptr %23, align 4, !tbaa !5
  %215 = load i32, ptr %22, align 4, !tbaa !5
  %216 = add nsw i32 %214, %215
  %217 = sext i32 %216 to i64
  %218 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([1010 x %"class.std::vector"], ptr @dp, i64 0, i64 1), i64 noundef %217) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %219 = load i32, ptr %23, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([1010 x %"class.std::vector"], ptr @dp, i64 0, i64 1), i64 noundef %220) #7
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %24, align 4, !tbaa !5
  %224 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %218, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = load i32, ptr %23, align 4, !tbaa !5
  %227 = load i32, ptr %22, align 4, !tbaa !5
  %228 = add nsw i32 %226, %227
  %229 = sext i32 %228 to i64
  %230 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([1010 x %"class.std::vector"], ptr @dp, i64 0, i64 1), i64 noundef %229) #7
  store i32 %225, ptr %230, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %231

231:                                              ; preds = %213, %208
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %23, align 4, !tbaa !5
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %23, align 4, !tbaa !5
  br label %202, !llvm.loop !18

235:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %236

236:                                              ; preds = %235
  %237 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %196

238:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %239

239:                                              ; preds = %364, %238
  %240 = load i32, ptr %25, align 4, !tbaa !5
  %241 = load i32, ptr @primesCount, align 4, !tbaa !5
  %242 = icmp sle i32 %240, %241
  br i1 %242, label %244, label %243

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

244:                                              ; preds = %239
  %245 = load i32, ptr %25, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %246
  %248 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %247) #7
  %249 = icmp ugt i64 %248, 0
  br i1 %249, label %250, label %363

250:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %251

251:                                              ; preds = %286, %250
  %252 = load i32, ptr %26, align 4, !tbaa !5
  %253 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %254 = shl i32 1, %253
  %255 = icmp slt i32 %252, %254
  br i1 %255, label %257, label %256

256:                                              ; preds = %251
  store i32 29, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %289

257:                                              ; preds = %251
  %258 = load i32, ptr %25, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %263
  %265 = load i32, ptr %26, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %264, i64 noundef %266) #7
  %268 = load i32, ptr %25, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %269
  %271 = load i32, ptr %26, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %270, i64 noundef %272) #7
  %274 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %267, ptr noundef nonnull align 4 dereferenceable(4) %273)
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = load i32, ptr %25, align 4, !tbaa !5
  %277 = add nsw i32 %276, 1
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %278
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %281
  %283 = load i32, ptr %26, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %282, i64 noundef %284) #7
  store i32 %275, ptr %285, align 4, !tbaa !5
  br label %286

286:                                              ; preds = %257
  %287 = load i32, ptr %26, align 4, !tbaa !5
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %26, align 4, !tbaa !5
  br label %251, !llvm.loop !19

289:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %290 = load i32, ptr %25, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %292
  %294 = load i32, ptr %293, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %295
  store ptr %296, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %297 = load ptr, ptr %27, align 8, !tbaa !9
  %298 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %297) #7
  %299 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %298, ptr %299, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %300 = load ptr, ptr %27, align 8, !tbaa !9
  %301 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %300) #7
  %302 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %301, ptr %302, align 8
  br label %303

303:                                              ; preds = %360, %289
  %304 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  br i1 %304, label %306, label %305

305:                                              ; preds = %303
  store i32 32, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %362

306:                                              ; preds = %303
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %307 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  %308 = load i32, ptr %307, align 4, !tbaa !5
  store i32 %308, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %309

309:                                              ; preds = %356, %306
  %310 = load i32, ptr %31, align 4, !tbaa !5
  %311 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %312 = shl i32 1, %311
  %313 = icmp slt i32 %310, %312
  br i1 %313, label %315, label %314

314:                                              ; preds = %309
  store i32 34, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %359

315:                                              ; preds = %309
  %316 = load i32, ptr %31, align 4, !tbaa !5
  %317 = load i32, ptr %30, align 4, !tbaa !5
  %318 = and i32 %316, %317
  %319 = icmp eq i32 %318, 0
  br i1 %319, label %320, label %355

320:                                              ; preds = %315
  %321 = load i32, ptr %25, align 4, !tbaa !5
  %322 = add nsw i32 %321, 1
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %323
  %325 = load i32, ptr %324, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %326
  %328 = load i32, ptr %31, align 4, !tbaa !5
  %329 = load i32, ptr %30, align 4, !tbaa !5
  %330 = add nsw i32 %328, %329
  %331 = sext i32 %330 to i64
  %332 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %327, i64 noundef %331) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %333 = load i32, ptr %25, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %334
  %336 = load i32, ptr %31, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %335, i64 noundef %337) #7
  %339 = load i32, ptr %338, align 4, !tbaa !5
  %340 = add nsw i32 %339, 1
  store i32 %340, ptr %32, align 4, !tbaa !5
  %341 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %332, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %342 = load i32, ptr %341, align 4, !tbaa !5
  %343 = load i32, ptr %25, align 4, !tbaa !5
  %344 = add nsw i32 %343, 1
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %345
  %347 = load i32, ptr %346, align 4, !tbaa !5
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %348
  %350 = load i32, ptr %31, align 4, !tbaa !5
  %351 = load i32, ptr %30, align 4, !tbaa !5
  %352 = add nsw i32 %350, %351
  %353 = sext i32 %352 to i64
  %354 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %349, i64 noundef %353) #7
  store i32 %342, ptr %354, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %355

355:                                              ; preds = %320, %315
  br label %356

356:                                              ; preds = %355
  %357 = load i32, ptr %31, align 4, !tbaa !5
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %31, align 4, !tbaa !5
  br label %309, !llvm.loop !20

359:                                              ; preds = %314
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %360

360:                                              ; preds = %359
  %361 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #7
  br label %303

362:                                              ; preds = %305
  br label %363

363:                                              ; preds = %362, %244
  br label %364

364:                                              ; preds = %363
  %365 = load i32, ptr %25, align 4, !tbaa !5
  %366 = add nsw i32 %365, 1
  store i32 %366, ptr %25, align 4, !tbaa !5
  br label %239, !llvm.loop !21

367:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %368

368:                                              ; preds = %384, %367
  %369 = load i32, ptr %34, align 4, !tbaa !5
  %370 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %371 = shl i32 1, %370
  %372 = icmp slt i32 %369, %371
  br i1 %372, label %374, label %373

373:                                              ; preds = %368
  store i32 37, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %387

374:                                              ; preds = %368
  %375 = load i32, ptr @primesCount, align 4, !tbaa !5
  %376 = add nsw i32 %375, 1
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %377
  %379 = load i32, ptr %34, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %378, i64 noundef %380) #7
  %382 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %381)
  %383 = load i32, ptr %382, align 4, !tbaa !5
  store i32 %383, ptr %33, align 4, !tbaa !5
  br label %384

384:                                              ; preds = %374
  %385 = load i32, ptr %34, align 4, !tbaa !5
  %386 = add nsw i32 %385, 1
  store i32 %386, ptr %34, align 4, !tbaa !5
  br label %368, !llvm.loop !22

387:                                              ; preds = %373
  %388 = load i32, ptr %33, align 4, !tbaa !5
  %389 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %388)
  %390 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %389, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %36, !llvm.loop !23

391:                                              ; preds = %36
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %392 = load i32, ptr %3, align 4
  ret i32 %392
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiEvT_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@smallerThanRoot = external dso_local local_unnamed_addr global i32, align 4
@primesCount = external dso_local local_unnamed_addr global i32, align 4
@remap = external dso_local local_unnamed_addr global [1010 x i32], align 16
@Next = external dso_local local_unnamed_addr global [1010 x i32], align 16
@initial = external dso_local global %"class.std::vector", align 8
@variants = external dso_local global [1010 x %"class.std::vector"], align 16
@dp = external dso_local global [1010 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z19generateSmallPrimesv() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  tail call void @_Z19generateSmallPrimesv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr %3, align 4, !tbaa !5
  %.not140 = icmp eq i32 %16, 0
  br i1 %.not140, label %._crit_edge141, label %.preheader87

18:                                               ; preds = %.preheader87
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @initial) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %.not78101 = icmp slt i32 %20, 1
  br i1 %.not78101, label %.preheader86, label %.lr.ph104

.preheader87:                                     ; preds = %2, %.preheader87.backedge
  %indvars.iv = phi i64 [ %indvars.iv.be, %.preheader87.backedge ], [ 1, %2 ]
  %21 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1001
  br i1 %exitcond.not, label %18, label %.preheader87.backedge

.preheader87.backedge:                            ; preds = %.preheader87, %._crit_edge139
  %indvars.iv.be = phi i64 [ %indvars.iv.next, %.preheader87 ], [ 1, %._crit_edge139 ]
  br label %.preheader87, !llvm.loop !9

.preheader86:                                     ; preds = %52, %18
  %22 = load i32, ptr @primesCount, align 4, !tbaa !5
  %.not79105 = icmp slt i32 %22, 0
  br i1 %.not79105, label %._crit_edge108.thread, label %.lr.ph107.preheader

.lr.ph107.preheader:                              ; preds = %.preheader86
  %23 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @variants, i64 24)) #7
  %24 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %25 = shl nuw i32 1, %24
  %26 = sext i32 %25 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24), i64 noundef %26)
  %27 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24)) #7
  %28 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24)) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiEvT_S7_RKT0_(ptr %27, ptr %28, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %.pre = load i32, ptr @primesCount, align 4, !tbaa !5
  %.not79.peel = icmp slt i32 %.pre, 1
  br i1 %.not79.peel, label %._crit_edge108.thread, label %.lr.ph107

.lr.ph104:                                        ; preds = %18, %52
  %.072102 = phi i32 [ %53, %52 ], [ 1, %18 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  %.promoted93 = load i32, ptr %5, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph104, %44
  %indvars.iv149 = phi i64 [ 2, %.lr.ph104 ], [ %indvars.iv.next150, %44 ]
  %.lcssa929599 = phi i32 [ %.promoted93, %.lr.ph104 ], [ %45, %44 ]
  %.lcssa919798 = phi i32 [ 0, %.lr.ph104 ], [ %.lcssa9196, %44 ]
  %30 = trunc nuw nsw i64 %indvars.iv149 to i32
  %31 = srem i32 %.lcssa929599, %30
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %.lr.ph, label %44

.lr.ph:                                           ; preds = %.preheader
  %33 = getelementptr inbounds [1010 x i32], ptr @remap, i64 0, i64 %indvars.iv149
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  br label %37

36:                                               ; preds = %44
  %.not84 = icmp eq i32 %45, 1
  br i1 %.not84, label %52, label %46

37:                                               ; preds = %.lr.ph, %37
  %38 = phi i32 [ %.lcssa929599, %.lr.ph ], [ %39, %37 ]
  %39 = sdiv i32 %38, %30
  %40 = srem i32 %39, %30
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %37, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %37
  %42 = shl nuw i32 1, %35
  %43 = or i32 %.lcssa919798, %42
  store i32 %43, ptr %6, align 4, !tbaa !5
  store i32 %39, ptr %5, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %._crit_edge, %.preheader
  %.lcssa9196 = phi i32 [ %43, %._crit_edge ], [ %.lcssa919798, %.preheader ]
  %45 = phi i32 [ %39, %._crit_edge ], [ %.lcssa929599, %.preheader ]
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %exitcond152.not = icmp eq i64 %indvars.iv.next150, 32
  br i1 %exitcond152.not, label %36, label %.preheader, !llvm.loop !12

46:                                               ; preds = %36
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [1010 x i32], ptr @remap, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %50
  br label %52

52:                                               ; preds = %36, %46
  %initial.sink = phi ptr [ %51, %46 ], [ @initial, %36 ]
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %initial.sink, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %53 = add nuw nsw i32 %.072102, 1
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %.not78.not = icmp slt i32 %.072102, %54
  br i1 %.not78.not, label %.lr.ph104, label %.preheader86, !llvm.loop !13

._crit_edge108.thread:                            ; preds = %.preheader86, %.lr.ph107.preheader
  %.lcssa88.ph = phi i32 [ %.pre, %.lr.ph107.preheader ], [ %22, %.preheader86 ]
  %.lcssa180 = add nsw i32 %.lcssa88.ph, 1
  %55 = sext i32 %.lcssa180 to i64
  %56 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %55
  store i32 %.lcssa180, ptr %56, align 4, !tbaa !5
  br label %._crit_edge113

._crit_edge108:                                   ; preds = %77
  %.lcssa = add nsw i32 %78, 1
  %57 = sext i32 %.lcssa to i64
  %58 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %57
  store i32 %.lcssa, ptr %58, align 4, !tbaa !5
  %59 = icmp sgt i32 %78, 0
  br i1 %59, label %.lr.ph112.preheader, label %._crit_edge113

.lr.ph112.preheader:                              ; preds = %._crit_edge108
  %60 = zext nneg i32 %78 to i64
  br label %.lr.ph112

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %77
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %77 ], [ 2, %.lr.ph107.preheader ]
  %61 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %indvars.iv153
  %62 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %.not83 = icmp eq i64 %62, 0
  br i1 %.not83, label %63, label %68

63:                                               ; preds = %.lr.ph107
  %64 = load i32, ptr @primesCount, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = zext i32 %65 to i64
  %67 = icmp eq i64 %indvars.iv153, %66
  br i1 %67, label %68, label %75

68:                                               ; preds = %63, %.lr.ph107
  %69 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %indvars.iv153
  %70 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %71 = shl nuw i32 1, %70
  %72 = sext i32 %71 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %72)
  %73 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #7
  %74 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %69) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiEvT_S7_RKT0_(ptr %73, ptr %74, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %77

75:                                               ; preds = %63
  %76 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %indvars.iv153
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #7
  br label %77

77:                                               ; preds = %68, %75
  %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
  %78 = load i32, ptr @primesCount, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %.not79 = icmp sgt i64 %indvars.iv153, %79
  br i1 %.not79, label %._crit_edge108, label %.lr.ph107, !llvm.loop !14

._crit_edge113:                                   ; preds = %92, %._crit_edge108.thread, %._crit_edge108
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24), i64 noundef 0) #7
  store i32 0, ptr %80, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %81 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @initial) #7
  store ptr %81, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %82 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @initial) #7
  store ptr %82, ptr %9, align 8
  %83 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %83, label %.lr.ph119, label %._crit_edge120

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %92
  %indvars.iv157 = phi i64 [ %60, %.lr.ph112.preheader ], [ %indvars.iv.next158, %92 ]
  %84 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %indvars.iv157
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %84) #7
  %.not82 = icmp eq i64 %85, 0
  br i1 %.not82, label %88, label %86

86:                                               ; preds = %.lr.ph112
  %87 = trunc nuw nsw i64 %indvars.iv157 to i32
  br label %92

88:                                               ; preds = %.lr.ph112
  %89 = add nuw nsw i64 %indvars.iv157, 1
  %90 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %86, %88
  %.sink = phi i32 [ %91, %88 ], [ %87, %86 ]
  %93 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %indvars.iv157
  store i32 %.sink, ptr %93, align 4
  %indvars.iv.next158 = add nsw i64 %indvars.iv157, -1
  %94 = icmp sgt i64 %indvars.iv157, 1
  br i1 %94, label %.lr.ph112, label %._crit_edge113, !llvm.loop !16

._crit_edge120:                                   ; preds = %._crit_edge117, %._crit_edge113
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %95 = load i32, ptr @primesCount, align 4, !tbaa !5
  %.not80131 = icmp slt i32 %95, 1
  br i1 %.not80131, label %._crit_edge135, label %.lr.ph134

.lr.ph119:                                        ; preds = %._crit_edge113, %._crit_edge117
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %.not142 = icmp eq i32 %98, 31
  br i1 %.not142, label %._crit_edge117, label %.lr.ph116.preheader

.lr.ph116.preheader:                              ; preds = %.lr.ph119
  %99 = sext i32 %97 to i64
  br label %.lr.ph116

._crit_edge117:                                   ; preds = %115, %.lr.ph119
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %101 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %101, label %.lr.ph119, label %._crit_edge120

.lr.ph116:                                        ; preds = %.lr.ph116.preheader, %115
  %102 = phi i32 [ %98, %.lr.ph116.preheader ], [ %116, %115 ]
  %indvars.iv160 = phi i64 [ 0, %.lr.ph116.preheader ], [ %indvars.iv.next161, %115 ]
  %103 = trunc nuw nsw i64 %indvars.iv160 to i32
  %104 = and i32 %97, %103
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %115

106:                                              ; preds = %.lr.ph116
  %107 = add nsw i64 %indvars.iv160, %99
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24), i64 noundef %107) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24), i64 noundef %indvars.iv160) #7
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !5
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %108, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @dp, i64 24), i64 noundef %107) #7
  store i32 %113, ptr %114, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %.pre175 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %.lr.ph116, %106
  %116 = phi i32 [ %102, %.lr.ph116 ], [ %.pre175, %106 ]
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %117 = shl nuw i32 1, %116
  %118 = sext i32 %117 to i64
  %119 = icmp slt i64 %indvars.iv.next161, %118
  br i1 %119, label %.lr.ph116, label %._crit_edge117, !llvm.loop !17

._crit_edge135:                                   ; preds = %178, %._crit_edge120
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  %120 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %.not145 = icmp eq i32 %120, 31
  br i1 %.not145, label %._crit_edge139, label %.lr.ph138

.lr.ph134:                                        ; preds = %._crit_edge120, %178
  %indvars.iv169 = phi i64 [ %indvars.iv.next170.pre-phi, %178 ], [ 1, %._crit_edge120 ]
  %121 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %indvars.iv169
  %122 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %121) #7
  %.not81 = icmp eq i64 %122, 0
  br i1 %.not81, label %.lr.ph134._crit_edge, label %.preheader85

.lr.ph134._crit_edge:                             ; preds = %.lr.ph134
  %.pre177 = add nuw nsw i64 %indvars.iv169, 1
  br label %178

.preheader85:                                     ; preds = %.lr.ph134
  %123 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %.not143 = icmp eq i32 %123, 31
  %.pre178 = add nuw nsw i64 %indvars.iv169, 1
  br i1 %.not143, label %._crit_edge123, label %.lr.ph122

.lr.ph122:                                        ; preds = %.preheader85
  %124 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %.pre178
  br label %132

._crit_edge123:                                   ; preds = %132, %.preheader85
  %125 = getelementptr inbounds [1010 x i32], ptr @Next, i64 0, i64 %.pre178
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @variants, i64 0, i64 %127
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %129 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #7
  store ptr %129, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %130 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #7
  store ptr %130, ptr %12, align 8
  %131 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br i1 %131, label %.lr.ph129, label %._crit_edge130

132:                                              ; preds = %.lr.ph122, %132
  %indvars.iv163 = phi i64 [ 0, %.lr.ph122 ], [ %indvars.iv.next164, %132 ]
  %133 = load i32, ptr %124, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %134
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %135, i64 noundef %indvars.iv163) #7
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %indvars.iv163) #7
  %138 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %136, ptr noundef nonnull align 4 dereferenceable(4) %137)
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %124, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %141
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %142, i64 noundef %indvars.iv163) #7
  store i32 %139, ptr %143, align 4, !tbaa !5
  %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
  %144 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %145 = shl nuw i32 1, %144
  %146 = sext i32 %145 to i64
  %147 = icmp slt i64 %indvars.iv.next164, %146
  br i1 %147, label %132, label %._crit_edge123, !llvm.loop !18

._crit_edge130:                                   ; preds = %._crit_edge127, %._crit_edge123
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %178

.lr.ph129:                                        ; preds = %._crit_edge123, %._crit_edge127
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %.not144 = icmp eq i32 %150, 31
  br i1 %.not144, label %._crit_edge127, label %.lr.ph126.preheader

.lr.ph126.preheader:                              ; preds = %.lr.ph129
  %151 = sext i32 %149 to i64
  br label %.lr.ph126

._crit_edge127:                                   ; preds = %173, %.lr.ph129
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %153 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br i1 %153, label %.lr.ph129, label %._crit_edge130

.lr.ph126:                                        ; preds = %.lr.ph126.preheader, %173
  %154 = phi i32 [ %150, %.lr.ph126.preheader ], [ %174, %173 ]
  %indvars.iv166 = phi i64 [ 0, %.lr.ph126.preheader ], [ %indvars.iv.next167, %173 ]
  %155 = trunc nuw nsw i64 %indvars.iv166 to i32
  %156 = and i32 %149, %155
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %173

158:                                              ; preds = %.lr.ph126
  %159 = load i32, ptr %125, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %160
  %162 = add nsw i64 %indvars.iv166, %151
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %161, i64 noundef %162) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %indvars.iv166) #7
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %13, align 4, !tbaa !5
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %163, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = load i32, ptr %125, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %170
  %172 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %171, i64 noundef %162) #7
  store i32 %168, ptr %172, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  %.pre176 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %.lr.ph126, %158
  %174 = phi i32 [ %154, %.lr.ph126 ], [ %.pre176, %158 ]
  %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
  %175 = shl nuw i32 1, %174
  %176 = sext i32 %175 to i64
  %177 = icmp slt i64 %indvars.iv.next167, %176
  br i1 %177, label %.lr.ph126, label %._crit_edge127, !llvm.loop !19

178:                                              ; preds = %.lr.ph134._crit_edge, %._crit_edge130
  %indvars.iv.next170.pre-phi = phi i64 [ %.pre177, %.lr.ph134._crit_edge ], [ %.pre178, %._crit_edge130 ]
  %179 = load i32, ptr @primesCount, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %.not80.not = icmp slt i64 %indvars.iv169, %180
  br i1 %.not80.not, label %.lr.ph134, label %._crit_edge135, !llvm.loop !20

._crit_edge139:                                   ; preds = %.lr.ph138, %._crit_edge135
  %181 = phi i32 [ 0, %._crit_edge135 ], [ %192, %.lr.ph138 ]
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %181)
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %184 = load i32, ptr %3, align 4, !tbaa !5
  %185 = add nsw i32 %184, -1
  store i32 %185, ptr %3, align 4, !tbaa !5
  %.not = icmp eq i32 %184, 0
  br i1 %.not, label %._crit_edge141, label %.preheader87.backedge

.lr.ph138:                                        ; preds = %._crit_edge135, %.lr.ph138
  %indvars.iv172 = phi i64 [ %indvars.iv.next173, %.lr.ph138 ], [ 0, %._crit_edge135 ]
  %186 = load i32, ptr @primesCount, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [1010 x %"class.std::vector"], ptr @dp, i64 0, i64 %188
  %190 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %189, i64 noundef %indvars.iv172) #7
  %191 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %190)
  %192 = load i32, ptr %191, align 4, !tbaa !5
  store i32 %192, ptr %14, align 4, !tbaa !5
  %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
  %193 = load i32, ptr @smallerThanRoot, align 4, !tbaa !5
  %194 = shl nuw i32 1, %193
  %195 = sext i32 %194 to i64
  %196 = icmp slt i64 %indvars.iv.next173, %195
  br i1 %196, label %.lr.ph138, label %._crit_edge139, !llvm.loop !21

._crit_edge141:                                   ; preds = %._crit_edge139, %2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiEvT_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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


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