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

; 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 }
%"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 [23 x i8], align 1
@.str.5 = 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 %"struct.primesieve::iterator", align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #5
  call void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %29, %0
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = icmp slt i32 %9, 10
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %8
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %13 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %14 unwind label %24

14:                                               ; preds = %12
  store i64 %13, ptr %5, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %23, %14
  %16 = load i64, ptr %5, align 8, !tbaa !5
  %17 = icmp ult i64 %16, 100000
  br i1 %17, label %18, label %28

18:                                               ; preds = %15
  %19 = load i64, ptr %3, align 8, !tbaa !5
  %20 = add i64 %19, 1
  store i64 %20, ptr %3, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %18
  %22 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
          to label %23 unwind label %24

23:                                               ; preds = %21
  store i64 %22, ptr %5, align 8, !tbaa !5
  br label %15, !llvm.loop !11

24:                                               ; preds = %21, %12
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %6, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %52

28:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %29

29:                                               ; preds = %28
  %30 = load i32, ptr %4, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %4, align 4, !tbaa !9
  br label %8, !llvm.loop !13

32:                                               ; preds = %11
  %33 = 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 %34 unwind label %48

34:                                               ; preds = %32
  %35 = load i64, ptr %3, align 8, !tbaa !5
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %33, i64 noundef %35)
          to label %37 unwind label %48

37:                                               ; preds = %34
  %38 = load i64, ptr %3, align 8, !tbaa !5
  %39 = icmp eq i64 %38, 95920
  invoke void @_Z5checkb(i1 noundef zeroext %39)
          to label %40 unwind label %48

40:                                               ; preds = %37
  %41 = 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 %42 unwind label %48

42:                                               ; preds = %40
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
          to label %44 unwind label %48

44:                                               ; preds = %42
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %46 unwind label %48

46:                                               ; preds = %44
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #5
  %47 = load i32, ptr %1, align 4
  ret i32 %47

48:                                               ; preds = %44, %42, %40, %37, %34, %32
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %6, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %7, align 4
  br label %52

52:                                               ; preds = %48, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #5
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %6, align 8
  %55 = load i32, ptr %7, align 4
  %56 = insertvalue { ptr, i32 } poison, ptr %54, 0
  %57 = insertvalue { ptr, i32 } %56, i32 %55, 1
  resume { ptr, i32 } %57
}

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

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

; Function Attrs: nounwind
declare void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !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::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 }
%"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 [23 x i8], align 1
@.str.5 = 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 %"struct.primesieve::iterator", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #5
  call void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %2 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %0
  %3 = icmp ult i64 %2, 100000
  br i1 %3, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %5
  %.116 = phi i64 [ %6, %5 ], [ 0, %.preheader ]
  %4 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %5 unwind label %.loopexit.loopexit

5:                                                ; preds = %.lr.ph
  %6 = add i64 %.116, 1
  %7 = icmp ult i64 %4, 100000
  br i1 %7, label %.lr.ph, label %._crit_edge, !llvm.loop !5

.loopexit.loopexit:                               ; preds = %.lr.ph
  %lpad.loopexit19 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

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

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

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

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

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

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

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

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

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

.loopexit.split-lp:                               ; preds = %._crit_edge.8, %._crit_edge.7, %._crit_edge.6, %._crit_edge.5, %._crit_edge.4, %._crit_edge.3, %._crit_edge.2, %._crit_edge.1, %._crit_edge, %0
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

._crit_edge:                                      ; preds = %5, %.preheader
  %.1.lcssa = phi i64 [ 0, %.preheader ], [ %6, %5 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %8 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.1 unwind label %.loopexit.split-lp

.preheader.1:                                     ; preds = %._crit_edge
  %9 = icmp ult i64 %8, 100000
  br i1 %9, label %.lr.ph.1, label %._crit_edge.1

.lr.ph.1:                                         ; preds = %.preheader.1, %11
  %.116.1 = phi i64 [ %12, %11 ], [ %.1.lcssa, %.preheader.1 ]
  %10 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %11 unwind label %.loopexit.loopexit.split-lp.loopexit

11:                                               ; preds = %.lr.ph.1
  %12 = add i64 %.116.1, 1
  %13 = icmp ult i64 %10, 100000
  br i1 %13, label %.lr.ph.1, label %._crit_edge.1, !llvm.loop !5

._crit_edge.1:                                    ; preds = %11, %.preheader.1
  %.1.lcssa.1 = phi i64 [ %.1.lcssa, %.preheader.1 ], [ %12, %11 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %14 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.2 unwind label %.loopexit.split-lp

.preheader.2:                                     ; preds = %._crit_edge.1
  %15 = icmp ult i64 %14, 100000
  br i1 %15, label %.lr.ph.2, label %._crit_edge.2

.lr.ph.2:                                         ; preds = %.preheader.2, %17
  %.116.2 = phi i64 [ %18, %17 ], [ %.1.lcssa.1, %.preheader.2 ]
  %16 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %17 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit

17:                                               ; preds = %.lr.ph.2
  %18 = add i64 %.116.2, 1
  %19 = icmp ult i64 %16, 100000
  br i1 %19, label %.lr.ph.2, label %._crit_edge.2, !llvm.loop !5

._crit_edge.2:                                    ; preds = %17, %.preheader.2
  %.1.lcssa.2 = phi i64 [ %.1.lcssa.1, %.preheader.2 ], [ %18, %17 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %20 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.3 unwind label %.loopexit.split-lp

.preheader.3:                                     ; preds = %._crit_edge.2
  %21 = icmp ult i64 %20, 100000
  br i1 %21, label %.lr.ph.3, label %._crit_edge.3

.lr.ph.3:                                         ; preds = %.preheader.3, %23
  %.116.3 = phi i64 [ %24, %23 ], [ %.1.lcssa.2, %.preheader.3 ]
  %22 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %23 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

23:                                               ; preds = %.lr.ph.3
  %24 = add i64 %.116.3, 1
  %25 = icmp ult i64 %22, 100000
  br i1 %25, label %.lr.ph.3, label %._crit_edge.3, !llvm.loop !5

._crit_edge.3:                                    ; preds = %23, %.preheader.3
  %.1.lcssa.3 = phi i64 [ %.1.lcssa.2, %.preheader.3 ], [ %24, %23 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %26 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.4 unwind label %.loopexit.split-lp

.preheader.4:                                     ; preds = %._crit_edge.3
  %27 = icmp ult i64 %26, 100000
  br i1 %27, label %.lr.ph.4, label %._crit_edge.4

.lr.ph.4:                                         ; preds = %.preheader.4, %29
  %.116.4 = phi i64 [ %30, %29 ], [ %.1.lcssa.3, %.preheader.4 ]
  %28 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %29 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

29:                                               ; preds = %.lr.ph.4
  %30 = add i64 %.116.4, 1
  %31 = icmp ult i64 %28, 100000
  br i1 %31, label %.lr.ph.4, label %._crit_edge.4, !llvm.loop !5

._crit_edge.4:                                    ; preds = %29, %.preheader.4
  %.1.lcssa.4 = phi i64 [ %.1.lcssa.3, %.preheader.4 ], [ %30, %29 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %32 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.5 unwind label %.loopexit.split-lp

.preheader.5:                                     ; preds = %._crit_edge.4
  %33 = icmp ult i64 %32, 100000
  br i1 %33, label %.lr.ph.5, label %._crit_edge.5

.lr.ph.5:                                         ; preds = %.preheader.5, %35
  %.116.5 = phi i64 [ %36, %35 ], [ %.1.lcssa.4, %.preheader.5 ]
  %34 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %35 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

35:                                               ; preds = %.lr.ph.5
  %36 = add i64 %.116.5, 1
  %37 = icmp ult i64 %34, 100000
  br i1 %37, label %.lr.ph.5, label %._crit_edge.5, !llvm.loop !5

._crit_edge.5:                                    ; preds = %35, %.preheader.5
  %.1.lcssa.5 = phi i64 [ %.1.lcssa.4, %.preheader.5 ], [ %36, %35 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %38 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.6 unwind label %.loopexit.split-lp

.preheader.6:                                     ; preds = %._crit_edge.5
  %39 = icmp ult i64 %38, 100000
  br i1 %39, label %.lr.ph.6, label %._crit_edge.6

.lr.ph.6:                                         ; preds = %.preheader.6, %41
  %.116.6 = phi i64 [ %42, %41 ], [ %.1.lcssa.5, %.preheader.6 ]
  %40 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %41 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

41:                                               ; preds = %.lr.ph.6
  %42 = add i64 %.116.6, 1
  %43 = icmp ult i64 %40, 100000
  br i1 %43, label %.lr.ph.6, label %._crit_edge.6, !llvm.loop !5

._crit_edge.6:                                    ; preds = %41, %.preheader.6
  %.1.lcssa.6 = phi i64 [ %.1.lcssa.5, %.preheader.6 ], [ %42, %41 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %44 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.7 unwind label %.loopexit.split-lp

.preheader.7:                                     ; preds = %._crit_edge.6
  %45 = icmp ult i64 %44, 100000
  br i1 %45, label %.lr.ph.7, label %._crit_edge.7

.lr.ph.7:                                         ; preds = %.preheader.7, %47
  %.116.7 = phi i64 [ %48, %47 ], [ %.1.lcssa.6, %.preheader.7 ]
  %46 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %47 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

47:                                               ; preds = %.lr.ph.7
  %48 = add i64 %.116.7, 1
  %49 = icmp ult i64 %46, 100000
  br i1 %49, label %.lr.ph.7, label %._crit_edge.7, !llvm.loop !5

._crit_edge.7:                                    ; preds = %47, %.preheader.7
  %.1.lcssa.7 = phi i64 [ %.1.lcssa.6, %.preheader.7 ], [ %48, %47 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %50 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.8 unwind label %.loopexit.split-lp

.preheader.8:                                     ; preds = %._crit_edge.7
  %51 = icmp ult i64 %50, 100000
  br i1 %51, label %.lr.ph.8, label %._crit_edge.8

.lr.ph.8:                                         ; preds = %.preheader.8, %53
  %.116.8 = phi i64 [ %54, %53 ], [ %.1.lcssa.7, %.preheader.8 ]
  %52 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %53 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

53:                                               ; preds = %.lr.ph.8
  %54 = add i64 %.116.8, 1
  %55 = icmp ult i64 %52, 100000
  br i1 %55, label %.lr.ph.8, label %._crit_edge.8, !llvm.loop !5

._crit_edge.8:                                    ; preds = %53, %.preheader.8
  %.1.lcssa.8 = phi i64 [ %.1.lcssa.7, %.preheader.8 ], [ %54, %53 ]
  call void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %56 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %.preheader.9 unwind label %.loopexit.split-lp

.preheader.9:                                     ; preds = %._crit_edge.8
  %57 = icmp ult i64 %56, 100000
  br i1 %57, label %.lr.ph.9, label %._crit_edge.9

.lr.ph.9:                                         ; preds = %.preheader.9, %59
  %.116.9 = phi i64 [ %60, %59 ], [ %.1.lcssa.8, %.preheader.9 ]
  %58 = invoke noundef i64 @_ZN10primesieve8iterator10next_primeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
          to label %59 unwind label %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

59:                                               ; preds = %.lr.ph.9
  %60 = add i64 %.116.9, 1
  %61 = icmp ult i64 %58, 100000
  br i1 %61, label %.lr.ph.9, label %._crit_edge.9, !llvm.loop !5

._crit_edge.9:                                    ; preds = %59, %.preheader.9
  %.1.lcssa.9 = phi i64 [ %.1.lcssa.8, %.preheader.9 ], [ %60, %59 ]
  %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.4)
          to label %63 unwind label %74

63:                                               ; preds = %._crit_edge.9
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %62, i64 noundef %.1.lcssa.9)
          to label %65 unwind label %74

65:                                               ; preds = %63
  %66 = icmp eq i64 %.1.lcssa.9, 95920
  invoke void @_Z5checkb(i1 noundef zeroext %66)
          to label %67 unwind label %74

67:                                               ; preds = %65
  %68 = 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 %69 unwind label %74

69:                                               ; preds = %67
  %70 = 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.5)
          to label %71 unwind label %74

71:                                               ; preds = %69
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %73 unwind label %74

73:                                               ; preds = %71
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #5
  ret i32 0

74:                                               ; preds = %71, %69, %67, %65, %63, %._crit_edge.9
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.loopexit.split-lp.loopexit, %.loopexit.split-lp, %74
  %.pn = phi { ptr, i32 } [ %75, %74 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit19, %.loopexit.loopexit ], [ %lpad.loopexit, %.loopexit.loopexit.split-lp.loopexit ], [ %lpad.loopexit23, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit26, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit29, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit32, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit35, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit38, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit41, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp42, %.loopexit.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN10primesieve8iteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #5
  resume { ptr, i32 } %.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: nounwind
declare void @_ZN10primesieve8iteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4

; Function Attrs: nounwind
declare void @_ZN10primesieve8iterator5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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