; LLVM IR from kimwalisch/primesieve :: src/EratMedium.ll (ZN10primesieve10EratMedium8crossOffERNS_6VectorIhSaIhEEE)

; 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::EratMedium" = type { %"class.primesieve::Wheel", i64, ptr, %"class.primesieve::Vector", %"class.primesieve::Vector" }
%"class.primesieve::Wheel" = type { ptr, i64 }
%"class.primesieve::Vector" = type { ptr, ptr, ptr }

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

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

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

; Function Attrs: mustprogress noinline uwtable
define dso_local void @_ZN10primesieve10EratMedium8crossOffERNS_6VectorIhSaIhEEE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 4
  %11 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 3
  call void @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EE4swapERS4_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %12

12:                                               ; preds = %101, %2
  %13 = load i64, ptr %5, align 8, !tbaa !9
  %14 = icmp ult i64 %13, 64
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %12
  %17 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 4
  %18 = load i64, ptr %5, align 8, !tbaa !9
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %18) #4
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %100

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %23 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 4
  %24 = load i64, ptr %5, align 8, !tbaa !9
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %24) #4
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = call noundef ptr @_ZN10primesieve6Bucket3getEPNS_12SievingPrimeE(ptr noundef %26)
  store ptr %27, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 4
  %30 = load i64, ptr %5, align 8, !tbaa !9
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %30) #4
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  call void @_ZN10primesieve6Bucket6setEndEPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(8192) %28, ptr noundef %32)
  %33 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 4
  %34 = load i64, ptr %5, align 8, !tbaa !9
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %34) #4
  store ptr null, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %36 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %36, ptr %7, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %92, %22
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %99

40:                                               ; preds = %37
  %41 = load i64, ptr %7, align 8, !tbaa !9
  %42 = udiv i64 %41, 8
  switch i64 %42, label %91 [
    i64 0, label %43
    i64 1, label %49
    i64 2, label %55
    i64 3, label %61
    i64 4, label %67
    i64 5, label %73
    i64 6, label %79
    i64 7, label %85
  ]

43:                                               ; preds = %40
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #4
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #4
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %45, i64 noundef %47, ptr noundef %48)
  br label %92

49:                                               ; preds = %40
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #4
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #4
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_11EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %51, i64 noundef %53, ptr noundef %54)
  br label %92

55:                                               ; preds = %40
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #4
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #4
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_13EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %57, i64 noundef %59, ptr noundef %60)
  br label %92

61:                                               ; preds = %40
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #4
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #4
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_17EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %63, i64 noundef %65, ptr noundef %66)
  br label %92

67:                                               ; preds = %40
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %68) #4
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #4
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_19EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %69, i64 noundef %71, ptr noundef %72)
  br label %92

73:                                               ; preds = %40
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #4
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %76) #4
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_23EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %75, i64 noundef %77, ptr noundef %78)
  br label %92

79:                                               ; preds = %40
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #4
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #4
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_29EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %81, i64 noundef %83, ptr noundef %84)
  br label %92

85:                                               ; preds = %40
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #4
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #4
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10primesieve10EratMedium11crossOff_31EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef %87, i64 noundef %89, ptr noundef %90)
  br label %92

91:                                               ; preds = %40
  unreachable

92:                                               ; preds = %85, %79, %73, %67, %61, %55, %49, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %93, ptr %8, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call noundef ptr @_ZN10primesieve6Bucket4nextEv(ptr noundef nonnull align 8 dereferenceable(8192) %94)
  store ptr %95, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.primesieve::EratMedium", ptr %9, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN10primesieve10MemoryPool10freeBucketEPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(40) %97, ptr noundef %98)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %37, !llvm.loop !15

99:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %100

100:                                              ; preds = %99, %16
  br label %101

101:                                              ; preds = %100
  %102 = load i64, ptr %5, align 8, !tbaa !9
  %103 = add i64 %102, 1
  store i64 %103, ptr %5, align 8, !tbaa !9
  br label %12, !llvm.loop !17

104:                                              ; preds = %15
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN10primesieve6Bucket3getEPNS_12SievingPrimeE(ptr noundef) #1 align 2

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

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

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

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

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_11EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_13EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_17EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_19EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_23EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_29EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_31EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) #2 align 2

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

declare void @_ZN10primesieve10MemoryPool10freeBucketEPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress noinline uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_ZTSN10primesieve10EratMediumE", !13, i64 0, !10, i64 16, !6, i64 24, !14, i64 32, !14, i64 56}
!13 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !10, i64 8}
!14 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress noinline uwtable
define dso_local void @_ZN10primesieve10EratMedium8crossOffERNS_6VectorIhSaIhEEE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 56
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EE4swapERS4_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  br label %7

6:                                                ; preds = %.loopexit
  ret void

7:                                                ; preds = %2, %.loopexit
  %.040 = phi i64 [ 0, %2 ], [ %32, %.loopexit ]
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.040) #3
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %.loopexit, label %10

10:                                               ; preds = %7
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.040) #3
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call noundef ptr @_ZN10primesieve6Bucket3getEPNS_12SievingPrimeE(ptr noundef %12)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.040) #3
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  tail call void @_ZN10primesieve6Bucket6setEndEPNS_12SievingPrimeE(ptr noundef nonnull align 8 dereferenceable(8192) %13, ptr noundef %15)
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.040) #3
  store ptr null, ptr %16, align 8, !tbaa !5
  %17 = lshr i64 %.040, 3
  br label %18

18:                                               ; preds = %10, %29
  %.03739 = phi ptr [ %13, %10 ], [ %30, %29 ]
  %19 = tail call noundef ptr @_ZN10primesieve6VectorIhSaIhEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %20 = tail call noundef i64 @_ZNK10primesieve6VectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  switch i64 %17, label %default.unreachable [
    i64 0, label %21
    i64 1, label %22
    i64 2, label %23
    i64 3, label %24
    i64 4, label %25
    i64 5, label %26
    i64 6, label %27
    i64 7, label %28
  ]

21:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

22:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_11EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

23:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_13EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

24:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_17EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

25:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_19EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

26:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_23EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

27:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_29EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

28:                                               ; preds = %18
  tail call void @_ZN10primesieve10EratMedium11crossOff_31EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %19, i64 noundef %20, ptr noundef nonnull %.03739)
  br label %29

default.unreachable:                              ; preds = %18
  unreachable

29:                                               ; preds = %28, %27, %26, %25, %24, %23, %22, %21
  %30 = tail call noundef ptr @_ZN10primesieve6Bucket4nextEv(ptr noundef nonnull align 8 dereferenceable(8192) %.03739)
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  tail call void @_ZN10primesieve10MemoryPool10freeBucketEPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(40) %31, ptr noundef nonnull %.03739)
  %.not38 = icmp eq ptr %30, null
  br i1 %.not38, label %.loopexit, label %18, !llvm.loop !14

.loopexit:                                        ; preds = %29, %7
  %32 = add nuw nsw i64 %.040, 1
  %exitcond.not = icmp eq i64 %32, 64
  br i1 %exitcond.not, label %6, label %7, !llvm.loop !16
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN10primesieve6Bucket3getEPNS_12SievingPrimeE(ptr noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium10crossOff_7EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_11EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_13EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_17EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_19EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_23EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_29EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress noinline uwtable
declare dso_local void @_ZN10primesieve10EratMedium11crossOff_31EPhmPNS_6BucketE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress noinline 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 = { 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, !6, i64 24}
!10 = !{!"_ZTSN10primesieve10EratMediumE", !11, i64 0, !12, i64 16, !6, i64 24, !13, i64 32, !13, i64 56}
!11 = !{!"_ZTSN10primesieve5WheelILi30ELi8ELi6EXadsoKNS_9WheelInitEL_ZNS_11wheel30InitEEEEEE", !12, i64 8}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSN10primesieve6VectorIPNS_12SievingPrimeESaIS2_EEE", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass