; LLVM IR from kimwalisch/primesieve :: test (next_prime1)

; 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::basic_ostream" = type { ptr, %"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.primesieve::iterator" = type { i64, i64, i64, i64, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkb(i1 noundef zeroext) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.primesieve::iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @_ZNSt6vectorImSaImEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZN10primesieve15generate_primesISt6vectorImSaImEEEEvmPT_(i64 noundef 100000, ptr noundef %2)
          to label %13 unwind label %21

13:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #6
  call void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %14 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %15 = sub i64 %14, 1
  store i64 %15, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %77, %13
  %17 = load i64, ptr %8, align 8, !tbaa !5
  %18 = load i64, ptr %6, align 8, !tbaa !5
  %19 = icmp ult i64 %17, %18
  br i1 %19, label %25, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %84

21:                                               ; preds = %0
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %3, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %4, align 4
  br label %175

25:                                               ; preds = %16
  %26 = load i64, ptr %8, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %26) #6
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = call noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #6
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %5, i64 noundef %28, i64 noundef %29) #6
  %30 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %31 unwind label %80

31:                                               ; preds = %25
  store i64 %30, ptr %7, align 8, !tbaa !5
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %33 unwind label %80

33:                                               ; preds = %31
  %34 = load i64, ptr %8, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %34) #6
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef %36)
          to label %38 unwind label %80

38:                                               ; preds = %33
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef @.str.5)
          to label %40 unwind label %80

40:                                               ; preds = %38
  %41 = load i64, ptr %7, align 8, !tbaa !5
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %41)
          to label %43 unwind label %80

43:                                               ; preds = %40
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = load i64, ptr %8, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %45) #6
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = icmp eq i64 %44, %47
  invoke void @_Z5checkb(i1 noundef zeroext %48)
          to label %49 unwind label %80

49:                                               ; preds = %43
  %50 = load i64, ptr %8, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %50) #6
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = add i64 %52, 1
  %54 = call noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #6
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %5, i64 noundef %53, i64 noundef %54) #6
  %55 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %56 unwind label %80

56:                                               ; preds = %49
  store i64 %55, ptr %7, align 8, !tbaa !5
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %58 unwind label %80

58:                                               ; preds = %56
  %59 = load i64, ptr %8, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %59) #6
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = add i64 %61, 1
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %57, i64 noundef %62)
          to label %64 unwind label %80

64:                                               ; preds = %58
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef @.str.5)
          to label %66 unwind label %80

66:                                               ; preds = %64
  %67 = load i64, ptr %7, align 8, !tbaa !5
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %65, i64 noundef %67)
          to label %69 unwind label %80

69:                                               ; preds = %66
  %70 = load i64, ptr %7, align 8, !tbaa !5
  %71 = load i64, ptr %8, align 8, !tbaa !5
  %72 = add i64 %71, 1
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %72) #6
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = icmp eq i64 %70, %74
  invoke void @_Z5checkb(i1 noundef zeroext %75)
          to label %76 unwind label %80

76:                                               ; preds = %69
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %8, align 8, !tbaa !5
  %79 = add i64 %78, 1
  store i64 %79, ptr %8, align 8, !tbaa !5
  br label %16, !llvm.loop !9

80:                                               ; preds = %69, %66, %64, %58, %56, %49, %43, %40, %38, %33, %31, %25
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %3, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %174

84:                                               ; preds = %20
  %85 = call noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #6
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %5, i64 noundef 0, i64 noundef %85) #6
  %86 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %87 unwind label %98

87:                                               ; preds = %84
  store i64 %86, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %97, %87
  %89 = load i64, ptr %7, align 8, !tbaa !5
  %90 = icmp ule i64 %89, 1000000000
  br i1 %90, label %91, label %106

91:                                               ; preds = %88
  %92 = load i64, ptr %7, align 8, !tbaa !5
  %93 = load i64, ptr %9, align 8, !tbaa !5
  %94 = add i64 %93, %92
  store i64 %94, ptr %9, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %91
  %96 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %97 unwind label %102

97:                                               ; preds = %95
  store i64 %96, ptr %7, align 8, !tbaa !5
  br label %88, !llvm.loop !11

98:                                               ; preds = %84
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %3, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %4, align 4
  br label %174

102:                                              ; preds = %169, %167, %165, %127, %114, %111, %108, %106, %95
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %3, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %4, align 4
  br label %173

106:                                              ; preds = %88
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
          to label %108 unwind label %102

108:                                              ; preds = %106
  %109 = load i64, ptr %9, align 8, !tbaa !5
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %107, i64 noundef %109)
          to label %111 unwind label %102

111:                                              ; preds = %108
  %112 = load i64, ptr %9, align 8, !tbaa !5
  %113 = icmp eq i64 %112, 24739512092254535
  invoke void @_Z5checkb(i1 noundef zeroext %113)
          to label %114 unwind label %102

114:                                              ; preds = %111
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %116 = load i64, ptr %115, align 8, !tbaa !5
  %117 = sub i64 %116, 200
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %119 = load i64, ptr %118, align 8, !tbaa !5
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %5, i64 noundef %117, i64 noundef %119) #6
  %120 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %121 unwind label %102

121:                                              ; preds = %114
  store i64 %120, ptr %7, align 8, !tbaa !5
  br label %122

122:                                              ; preds = %129, %121
  %123 = load i64, ptr %7, align 8, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = icmp ule i64 %123, %125
  br i1 %126, label %127, label %130

127:                                              ; preds = %122
  %128 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %129 unwind label %102

129:                                              ; preds = %127
  store i64 %128, ptr %7, align 8, !tbaa !5
  br label %122, !llvm.loop !12

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

131:                                              ; preds = %158, %130
  %132 = load i64, ptr %10, align 8, !tbaa !5
  %133 = icmp ult i64 %132, 1000
  br i1 %133, label %135, label %134

134:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %165

135:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %136 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %136, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %137 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %138 = load i64, ptr %10, align 8, !tbaa !5
  %139 = sub i64 %137, %138
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %139) #6
  %141 = load i64, ptr %140, align 8, !tbaa !5
  store i64 %141, ptr %12, align 8, !tbaa !5
  %142 = invoke noundef i64 @_ZN10primesieve8iterator10prev_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %143 unwind label %161

143:                                              ; preds = %135
  store i64 %142, ptr %7, align 8, !tbaa !5
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
          to label %145 unwind label %161

145:                                              ; preds = %143
  %146 = load i64, ptr %11, align 8, !tbaa !5
  %147 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %144, i64 noundef %146)
          to label %148 unwind label %161

148:                                              ; preds = %145
  %149 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @.str.5)
          to label %150 unwind label %161

150:                                              ; preds = %148
  %151 = load i64, ptr %7, align 8, !tbaa !5
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %149, i64 noundef %151)
          to label %153 unwind label %161

153:                                              ; preds = %150
  %154 = load i64, ptr %7, align 8, !tbaa !5
  %155 = load i64, ptr %12, align 8, !tbaa !5
  %156 = icmp eq i64 %154, %155
  invoke void @_Z5checkb(i1 noundef zeroext %156)
          to label %157 unwind label %161

157:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %10, align 8, !tbaa !5
  %160 = add i64 %159, 1
  store i64 %160, ptr %10, align 8, !tbaa !5
  br label %131, !llvm.loop !13

161:                                              ; preds = %153, %150, %148, %145, %143, %135
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %3, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %173

165:                                              ; preds = %134
  %166 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %167 unwind label %102

167:                                              ; preds = %165
  %168 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.8)
          to label %169 unwind label %102

169:                                              ; preds = %167
  %170 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %168, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %171 unwind label %102

171:                                              ; preds = %169
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #6
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  %172 = load i32, ptr %1, align 4
  ret i32 %172

173:                                              ; preds = %161, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %174

174:                                              ; preds = %173, %98, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #6
  br label %175

175:                                              ; preds = %174, %21
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %3, align 8
  %178 = load i32, ptr %4, align 4
  %179 = insertvalue { ptr, i32 } poison, ptr %177, 0
  %180 = insertvalue { ptr, i32 } %179, i32 %178, 1
  resume { ptr, i32 } %180
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10primesieve15generate_primesISt6vectorImSaImEEEEvmPT_(i64 noundef, ptr noundef) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5

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

; Function Attrs: nounwind
declare void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #4 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

; Function Attrs: nounwind
declare void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5

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

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


; 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::basic_ostream" = type { ptr, %"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.primesieve::iterator" = type { i64, i64, i64, i64, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkb(i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"struct.primesieve::iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt6vectorImSaImEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  invoke void @_ZN10primesieve15generate_primesISt6vectorImSaImEEEEvmPT_(i64 noundef 100000, ptr noundef nonnull %1)
          to label %3 unwind label %11

3:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #6
  call void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  %4 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %5 = add i64 %4, -1
  br label %6

6:                                                ; preds = %49, %3
  %.031 = phi i64 [ 0, %3 ], [ %50, %49 ]
  %exitcond.not = icmp eq i64 %.031, %5
  br i1 %exitcond.not, label %7, label %13

7:                                                ; preds = %6
  %8 = call noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #6
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef 0, i64 noundef %8) #6
  %9 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %.preheader43 unwind label %60

.preheader43:                                     ; preds = %7
  %10 = icmp ult i64 %9, 1000000001
  br i1 %10, label %.lr.ph, label %._crit_edge

11:                                               ; preds = %0
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %104

13:                                               ; preds = %6
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.031) #6
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = call noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #6
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef %15, i64 noundef %16) #6
  %17 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %18 unwind label %54

18:                                               ; preds = %13
  %19 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %20 unwind label %54

20:                                               ; preds = %18
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.031) #6
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %19, i64 noundef %22)
          to label %24 unwind label %54

24:                                               ; preds = %20
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str.5)
          to label %26 unwind label %54

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %25, i64 noundef %17)
          to label %28 unwind label %54

28:                                               ; preds = %26
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.031) #6
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = icmp eq i64 %17, %30
  invoke void @_Z5checkb(i1 noundef zeroext %31)
          to label %32 unwind label %54

32:                                               ; preds = %28
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.031) #6
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add i64 %34, 1
  %36 = call noundef i64 @_ZNSt14numeric_limitsImE3maxEv() #6
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef %35, i64 noundef %36) #6
  %37 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %38 unwind label %54

38:                                               ; preds = %32
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %40 unwind label %54

40:                                               ; preds = %38
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.031) #6
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = add i64 %42, 1
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %39, i64 noundef %43)
          to label %45 unwind label %54

45:                                               ; preds = %40
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @.str.5)
          to label %47 unwind label %54

47:                                               ; preds = %45
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %46, i64 noundef %37)
          to label %49 unwind label %54

49:                                               ; preds = %47
  %50 = add i64 %.031, 1
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %50) #6
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = icmp eq i64 %37, %52
  invoke void @_Z5checkb(i1 noundef zeroext %53)
          to label %6 unwind label %54, !llvm.loop !9

54:                                               ; preds = %49, %47, %45, %40, %38, %32, %28, %26, %24, %20, %18, %13
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.lr.ph:                                           ; preds = %.preheader43, %57
  %.03050 = phi i64 [ %58, %57 ], [ 0, %.preheader43 ]
  %.03249 = phi i64 [ %56, %57 ], [ %9, %.preheader43 ]
  %56 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %57 unwind label %.loopexit.split-lp.loopexit

57:                                               ; preds = %.lr.ph
  %58 = add i64 %.03050, %.03249
  %59 = icmp ult i64 %56, 1000000001
  br i1 %59, label %.lr.ph, label %._crit_edge, !llvm.loop !11

60:                                               ; preds = %7
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit:                                        ; preds = %76
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %.lr.ph
  %lpad.loopexit44 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %101, %99, %78, %67, %65, %63, %._crit_edge
  %lpad.loopexit.split-lp45 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

._crit_edge:                                      ; preds = %57, %.preheader43
  %.030.lcssa = phi i64 [ 0, %.preheader43 ], [ %58, %57 ]
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
          to label %63 unwind label %.loopexit.split-lp.loopexit.split-lp

63:                                               ; preds = %._crit_edge
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %62, i64 noundef %.030.lcssa)
          to label %65 unwind label %.loopexit.split-lp.loopexit.split-lp

65:                                               ; preds = %63
  %66 = icmp eq i64 %.030.lcssa, 24739512092254535
  invoke void @_Z5checkb(i1 noundef zeroext %66)
          to label %67 unwind label %.loopexit.split-lp.loopexit.split-lp

67:                                               ; preds = %65
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = add i64 %69, -200
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %72 = load i64, ptr %71, align 8, !tbaa !5
  call void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef %70, i64 noundef %72) #6
  %73 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %.preheader42 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader42:                                     ; preds = %67, %76
  %.133 = phi i64 [ %77, %76 ], [ %73, %67 ]
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %.not = icmp ugt i64 %.133, %75
  br i1 %.not, label %.preheader, label %76

76:                                               ; preds = %.preheader42
  %77 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %.preheader42 unwind label %.loopexit, !llvm.loop !12

78:                                               ; preds = %95
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %99 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader:                                       ; preds = %.preheader42, %95
  %.02952 = phi i64 [ %96, %95 ], [ 1, %.preheader42 ]
  %.23451 = phi i64 [ %84, %95 ], [ %.133, %.preheader42 ]
  %80 = call noundef i64 @_ZNKSt6vectorImSaImEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %81 = sub i64 %80, %.02952
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %81) #6
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = invoke noundef i64 @_ZN10primesieve8iterator10prev_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %85 unwind label %97

85:                                               ; preds = %.preheader
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.7)
          to label %87 unwind label %97

87:                                               ; preds = %85
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %86, i64 noundef %.23451)
          to label %89 unwind label %97

89:                                               ; preds = %87
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @.str.5)
          to label %91 unwind label %97

91:                                               ; preds = %89
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %90, i64 noundef %84)
          to label %93 unwind label %97

93:                                               ; preds = %91
  %94 = icmp eq i64 %84, %83
  invoke void @_Z5checkb(i1 noundef zeroext %94)
          to label %95 unwind label %97

95:                                               ; preds = %93
  %96 = add nuw nsw i64 %.02952, 1
  %exitcond54.not = icmp eq i64 %96, 1000
  br i1 %exitcond54.not, label %78, label %.preheader, !llvm.loop !13

97:                                               ; preds = %93, %91, %89, %87, %85, %.preheader
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

99:                                               ; preds = %78
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.8)
          to label %101 unwind label %.loopexit.split-lp.loopexit.split-lp

101:                                              ; preds = %99
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %103 unwind label %.loopexit.split-lp.loopexit.split-lp

103:                                              ; preds = %101
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret i32 0

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %97, %60, %54
  %.pn39 = phi { ptr, i32 } [ %55, %54 ], [ %61, %60 ], [ %98, %97 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit44, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp45, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  br label %104

104:                                              ; preds = %.loopexit.split-lp, %11
  %.pn39.pn = phi { ptr, i32 } [ %.pn39, %.loopexit.split-lp ], [ %12, %11 ]
  call void @_ZNSt6vectorImSaImEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn39.pn
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10primesieve15generate_primesISt6vectorImSaImEEEEvmPT_(i64 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5

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

; Function Attrs: nounwind
declare void @_ZN10primesieve8iterator7jump_toEmm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt14numeric_limitsImE3maxEv() local_unnamed_addr #4 align 2

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

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

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

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

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

; 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 #0 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)) #1

; Function Attrs: nounwind
declare void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #5

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass