; LLVM IR from kimwalisch/primesieve :: src/CountPrintPrimes.ll (ZN10primesieve16CountPrintPrimesC2ERNS_10PrimeSieveE)

; 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.primesieve::CountPrintPrimes" = type { %"class.primesieve::Erat", i64, [6 x %"class.primesieve::Vector"], ptr, ptr, %"class.primesieve::MemoryPool" }
%"class.primesieve::Erat" = type { i64, i64, i64, i64, %"class.primesieve::Vector", i64, i64, %"class.primesieve::EratSmall", %"class.primesieve::EratBig", %"class.primesieve::EratMedium" }
%"class.primesieve::Vector" = type { ptr, ptr, ptr }
%"class.primesieve::EratSmall" = type { %"class.primesieve::Wheel", i64, i64, %"class.primesieve::Vector.0" }
%"class.primesieve::Wheel" = type { ptr, i64 }
%"class.primesieve::Vector.0" = type { ptr, ptr, ptr }
%"class.primesieve::EratBig" = type { %"class.primesieve::Wheel.1", i64, i64, i64, ptr, %"class.primesieve::Vector.2" }
%"class.primesieve::Wheel.1" = type { ptr, i64 }
%"class.primesieve::Vector.2" = type { ptr, ptr, ptr }
%"class.primesieve::EratMedium" = type { %"class.primesieve::Wheel", i64, ptr, %"class.primesieve::Vector.2", %"class.primesieve::Vector.2" }
%"class.primesieve::MemoryPool" = type { ptr, i64, %"class.primesieve::Vector.3" }
%"class.primesieve::Vector.3" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10primesieve16CountPrintPrimesC2ERNS_10PrimeSieveE(ptr noundef nonnull align 8 dereferenceable(488) %0, ptr noundef nonnull align 8 dereferenceable(120) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @_ZN10primesieve4EratC2Ev(ptr noundef nonnull align 8 dereferenceable(280) %11) #5
  %12 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 1
  store i64 0, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 2
  %14 = getelementptr inbounds [6 x %"class.primesieve::Vector"], ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %"class.primesieve::Vector", ptr %14, i64 6
  br label %16

16:                                               ; preds = %16, %2
  %17 = phi ptr [ %14, %2 ], [ %18, %16 ]
  call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %18 = getelementptr inbounds %"class.primesieve::Vector", ptr %17, i64 1
  %19 = icmp eq ptr %18, %15
  br i1 %19, label %20, label %16

20:                                               ; preds = %16
  %21 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 3
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZN10primesieve10PrimeSieve9getCountsEv(ptr noundef nonnull align 8 dereferenceable(120) %22)
          to label %24 unwind label %52

24:                                               ; preds = %20
  store ptr %23, ptr %21, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 4
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %26, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 5
  call void @_ZN10primesieve10MemoryPoolC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = invoke noundef i64 @_ZNK10primesieve10PrimeSieve8getStartEv(ptr noundef nonnull align 8 dereferenceable(120) %28)
          to label %30 unwind label %56

30:                                               ; preds = %24
  store i64 %29, ptr %7, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = invoke noundef i64 @_ZNK10primesieve10PrimeSieve7getStopEv(ptr noundef nonnull align 8 dereferenceable(120) %31)
          to label %33 unwind label %60

33:                                               ; preds = %30
  store i64 %32, ptr %8, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = invoke noundef i32 @_ZNK10primesieve10PrimeSieve12getSieveSizeEv(ptr noundef nonnull align 8 dereferenceable(120) %34)
          to label %36 unwind label %64

36:                                               ; preds = %33
  %37 = sext i32 %35 to i64
  store i64 %37, ptr %9, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 7, ptr %10, align 8, !tbaa !23
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %39 unwind label %68

39:                                               ; preds = %36
  %40 = load i64, ptr %38, align 8, !tbaa !23
  store i64 %40, ptr %7, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %41 = load i64, ptr %7, align 8, !tbaa !23
  %42 = load i64, ptr %8, align 8, !tbaa !23
  %43 = load i64, ptr %9, align 8, !tbaa !23
  %44 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 5
  invoke void @_ZN10primesieve4Erat4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(280) %11, i64 noundef %41, i64 noundef %42, i64 noundef %43, ptr noundef nonnull align 8 dereferenceable(40) %44)
          to label %45 unwind label %64

45:                                               ; preds = %39
  %46 = getelementptr inbounds %"class.primesieve::CountPrintPrimes", ptr %11, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !24
  %48 = invoke noundef zeroext i1 @_ZNK10primesieve10PrimeSieve15isCountkTupletsEv(ptr noundef nonnull align 8 dereferenceable(120) %47)
          to label %49 unwind label %64

49:                                               ; preds = %45
  br i1 %48, label %50, label %72

50:                                               ; preds = %49
  invoke void @_ZN10primesieve16CountPrintPrimes10initCountsEv(ptr noundef nonnull align 8 dereferenceable(488) %11)
          to label %51 unwind label %64

51:                                               ; preds = %50
  br label %72

52:                                               ; preds = %20
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %5, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %6, align 4
  br label %76

56:                                               ; preds = %24
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %5, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %6, align 4
  br label %75

60:                                               ; preds = %30
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %5, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %6, align 4
  br label %74

64:                                               ; preds = %50, %45, %39, %33
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %5, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %6, align 4
  br label %73

68:                                               ; preds = %36
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %5, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %73

72:                                               ; preds = %51, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

73:                                               ; preds = %68, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %74

74:                                               ; preds = %73, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %75

75:                                               ; preds = %74, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZN10primesieve10MemoryPoolD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %27) #5
  br label %76

76:                                               ; preds = %75, %52
  %77 = getelementptr inbounds [6 x %"class.primesieve::Vector"], ptr %13, i32 0, i32 0
  %78 = getelementptr inbounds %"class.primesieve::Vector", ptr %77, i64 6
  br label %79

79:                                               ; preds = %79, %76
  %80 = phi ptr [ %78, %76 ], [ %81, %79 ]
  %81 = getelementptr inbounds %"class.primesieve::Vector", ptr %80, i64 -1
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %81) #5
  %82 = icmp eq ptr %81, %77
  br i1 %82, label %83, label %79

83:                                               ; preds = %79
  call void @_ZN10primesieve4EratD2Ev(ptr noundef nonnull align 8 dereferenceable(280) %11) #5
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %5, align 8
  %86 = load i32, ptr %6, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

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

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

declare noundef nonnull align 8 dereferenceable(48) ptr @_ZN10primesieve10PrimeSieve9getCountsEv(ptr noundef nonnull align 8 dereferenceable(120)) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve10MemoryPoolC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

declare noundef i64 @_ZNK10primesieve10PrimeSieve8getStartEv(ptr noundef nonnull align 8 dereferenceable(120)) #2

declare noundef i64 @_ZNK10primesieve10PrimeSieve7getStopEv(ptr noundef nonnull align 8 dereferenceable(120)) #2

declare noundef i32 @_ZNK10primesieve10PrimeSieve12getSieveSizeEv(ptr noundef nonnull align 8 dereferenceable(120)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

declare void @_ZN10primesieve4Erat4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(280), i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(40)) #2

declare noundef zeroext i1 @_ZNK10primesieve10PrimeSieve15isCountkTupletsEv(ptr noundef nonnull align 8 dereferenceable(120)) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve10MemoryPoolD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve4EratD2Ev(ptr noundef nonnull align 8 dereferenceable(280)) unnamed_addr #3 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 280}
!10 = !{!"_ZTSN10primesieve16CountPrintPrimesE", !11, i64 0, !12, i64 280, !7, i64 288, !6, i64 432, !6, i64 440, !21, i64 448}
!11 = !{!"_ZTSN10primesieve4EratE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32, !12, i64 56, !12, i64 64, !14, i64 72, !17, i64 128, !20, i64 200}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSN10primesieve6VectorIhSaIhEEE", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!"_ZTSN10primesieve9EratSmallE", !15, i64 0, !12, i64 16, !12, i64 24, !16, i64 32}
!15 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !12, i64 8}
!16 = !{!"_ZTSN10primesieve6VectorINS_12SievingPrimeESaIS1_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSN10primesieve7EratBigE", !18, i64 0, !12, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !19, i64 48}
!18 = !{!"_ZTSN10primesieve5WheelILi210ELi48ELi10EXadsoKNS_9WheelInitEL_ZNS_12wheel210InitEEEEEE", !12, i64 8}
!19 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSN10primesieve10EratMediumE", !15, i64 0, !12, i64 16, !6, i64 24, !19, i64 32, !19, i64 56}
!21 = !{!"_ZTSN10primesieve10MemoryPoolE", !6, i64 0, !12, i64 8, !22, i64 16}
!22 = !{!"_ZTSN10primesieve6VectorINS0_IcSaIcEEESaIS2_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!12, !12, i64 0}
!24 = !{!10, !6, i64 440}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10primesieve16CountPrintPrimesC2ERNS_10PrimeSieveE(ptr noundef nonnull align 8 dereferenceable(488) %0, ptr noundef nonnull align 8 dereferenceable(120) %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  tail call void @_ZN10primesieve4EratC2Ev(ptr noundef nonnull align 8 dereferenceable(280) %0) #5
  %5 = getelementptr inbounds i8, ptr %0, i64 280
  store i64 0, ptr %5, align 8, !tbaa !5
  %.ptr = getelementptr inbounds i8, ptr %0, i64 288
  tail call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #5
  %.ptr.1 = getelementptr inbounds i8, ptr %0, i64 312
  tail call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1) #5
  %.ptr.2 = getelementptr inbounds i8, ptr %0, i64 336
  tail call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2) #5
  %.ptr.3 = getelementptr inbounds i8, ptr %0, i64 360
  tail call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3) #5
  %.ptr.4 = getelementptr inbounds i8, ptr %0, i64 384
  tail call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.4) #5
  %.ptr.5 = getelementptr inbounds i8, ptr %0, i64 408
  tail call void @_ZN10primesieve6VectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.5) #5
  %6 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZN10primesieve10PrimeSieve9getCountsEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
          to label %7 unwind label %25

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 432
  store ptr %6, ptr %8, align 8, !tbaa !22
  %9 = getelementptr inbounds i8, ptr %0, i64 440
  store ptr %1, ptr %9, align 8, !tbaa !22
  %10 = getelementptr inbounds i8, ptr %0, i64 448
  tail call void @_ZN10primesieve10MemoryPoolC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %11 = invoke noundef i64 @_ZNK10primesieve10PrimeSieve8getStartEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
          to label %12 unwind label %27

12:                                               ; preds = %7
  store i64 %11, ptr %3, align 8, !tbaa !23
  %13 = invoke noundef i64 @_ZNK10primesieve10PrimeSieve7getStopEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
          to label %14 unwind label %29

14:                                               ; preds = %12
  %15 = invoke noundef i32 @_ZNK10primesieve10PrimeSieve12getSieveSizeEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
          to label %16 unwind label %31

16:                                               ; preds = %14
  %17 = sext i32 %15 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 7, ptr %4, align 8, !tbaa !23
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %19 = load i64, ptr %18, align 8, !tbaa !23
  store i64 %19, ptr %3, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  invoke void @_ZN10primesieve4Erat4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(280) %0, i64 noundef %19, i64 noundef %13, i64 noundef %17, ptr noundef nonnull align 8 dereferenceable(40) %10)
          to label %20 unwind label %31

20:                                               ; preds = %16
  %21 = load ptr, ptr %9, align 8, !tbaa !24
  %22 = invoke noundef zeroext i1 @_ZNK10primesieve10PrimeSieve15isCountkTupletsEv(ptr noundef nonnull align 8 dereferenceable(120) %21)
          to label %23 unwind label %31

23:                                               ; preds = %20
  br i1 %22, label %24, label %33

24:                                               ; preds = %23
  invoke void @_ZN10primesieve16CountPrintPrimes10initCountsEv(ptr noundef nonnull align 8 dereferenceable(488) %0)
          to label %33 unwind label %31

25:                                               ; preds = %2
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %35

27:                                               ; preds = %7
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %34

29:                                               ; preds = %12
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %34

31:                                               ; preds = %24, %20, %16, %14
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %34

33:                                               ; preds = %24, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret void

34:                                               ; preds = %29, %31, %27
  %.pn.pn = phi { ptr, i32 } [ %28, %27 ], [ %32, %31 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @_ZN10primesieve10MemoryPoolD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %10) #5
  br label %35

35:                                               ; preds = %34, %25
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %34 ], [ %26, %25 ]
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.5) #5
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.4) #5
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.3) #5
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2) #5
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1) #5
  call void @_ZN10primesieve6VectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #5
  call void @_ZN10primesieve4EratD2Ev(ptr noundef nonnull align 8 dereferenceable(280) %0) #5
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

declare noundef nonnull align 8 dereferenceable(48) ptr @_ZN10primesieve10PrimeSieve9getCountsEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve10MemoryPoolC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

declare noundef i64 @_ZNK10primesieve10PrimeSieve8getStartEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

declare noundef i64 @_ZNK10primesieve10PrimeSieve7getStopEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

declare noundef i32 @_ZNK10primesieve10PrimeSieve12getSieveSizeEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

declare void @_ZN10primesieve4Erat4initEmmmRNS_10MemoryPoolE(ptr noundef nonnull align 8 dereferenceable(280), i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK10primesieve10PrimeSieve15isCountkTupletsEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve10MemoryPoolD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10primesieve4EratD2Ev(ptr noundef nonnull align 8 dereferenceable(280)) unnamed_addr #3 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !8, i64 280}
!6 = !{!"_ZTSN10primesieve16CountPrintPrimesE", !7, i64 0, !8, i64 280, !9, i64 288, !12, i64 432, !12, i64 440, !20, i64 448}
!7 = !{!"_ZTSN10primesieve4EratE", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !11, i64 32, !8, i64 56, !8, i64 64, !13, i64 72, !16, i64 128, !19, i64 200}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN10primesieve6VectorIhSaIhEEE", !12, i64 0, !12, i64 8, !12, i64 16}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"_ZTSN10primesieve9EratSmallE", !14, i64 0, !8, i64 16, !8, i64 24, !15, i64 32}
!14 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !8, i64 8}
!15 = !{!"_ZTSN10primesieve6VectorINS_12SievingPrimeESaIS1_EEE", !12, i64 0, !12, i64 8, !12, i64 16}
!16 = !{!"_ZTSN10primesieve7EratBigE", !17, i64 0, !8, i64 16, !8, i64 24, !8, i64 32, !12, i64 40, !18, i64 48}
!17 = !{!"_ZTSN10primesieve5WheelILi210ELi48ELi10EXadsoKNS_9WheelInitEL_ZNS_12wheel210InitEEEEEE", !8, i64 8}
!18 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !12, i64 0, !12, i64 8, !12, i64 16}
!19 = !{!"_ZTSN10primesieve10EratMediumE", !14, i64 0, !8, i64 16, !12, i64 24, !18, i64 32, !18, i64 56}
!20 = !{!"_ZTSN10primesieve10MemoryPoolE", !12, i64 0, !8, i64 8, !21, i64 16}
!21 = !{!"_ZTSN10primesieve6VectorINS0_IcSaIcEEESaIS2_EEE", !12, i64 0, !12, i64 8, !12, i64 16}
!22 = !{!12, !12, i64 0}
!23 = !{!8, !8, i64 0}
!24 = !{!6, !12, i64 440}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass