; LLVM IR from sgtlaugh/algovault :: code_library/fast_prime_counting.ll (Z5sievev)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::bitset<20000010>::reference" = type { ptr, i64 }

@primes = external dso_local global %"class.std::vector", align 8
@is_prime = external dso_local global { [312501 x i64] }, align 8
@pi = external dso_local global [20000010 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5sievev() #0 {
  %1 = alloca %"class.std::bitset<20000010>::reference", align 8
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::bitset<20000010>::reference", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::bitset<20000010>::reference", align 8
  %8 = alloca %"class.std::bitset<20000010>::reference", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::bitset<20000010>::reference", align 8
  %11 = alloca %"class.std::bitset<20000010>::reference", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %1) #3
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<20000010>::reference") align 8 %1, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef 2)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 3, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %21, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 20000010
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %24

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #3
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<20000010>::reference") align 8 %3, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %19)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %3, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #3
  br label %21

21:                                               ; preds = %17
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 2
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

24:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 3, ptr %4, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %55, %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = mul nsw i32 %26, %27
  %29 = icmp slt i32 %28, 20000010
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %58

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = mul nsw i32 %32, %33
  store i32 %34, ptr %6, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %49, %31
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<20000010>::reference") align 8 %7, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %37)
  %38 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  br i1 %38, label %39, label %42

39:                                               ; preds = %35
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 20000010
  br label %42

42:                                               ; preds = %39, %35
  %43 = phi i1 [ false, %35 ], [ %41, %39 ]
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  br i1 %43, label %45, label %44

44:                                               ; preds = %42
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %54

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<20000010>::reference") align 8 %8, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %47)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %8, i1 noundef zeroext false) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  br label %49

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

54:                                               ; preds = %44
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = add nsw i32 %56, 2
  store i32 %57, ptr %4, align 4, !tbaa !5
  br label %25, !llvm.loop !12

58:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %82, %58
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 20000010
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %85

63:                                               ; preds = %59
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [20000010 x i32], ptr @pi, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<20000010>::reference") align 8 %10, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %70)
  %71 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #3
  %72 = zext i1 %71 to i32
  %73 = add nsw i32 %68, %72
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [20000010 x i32], ptr @pi, i64 0, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !5
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #3
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<20000010>::reference") align 8 %11, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %78)
  %79 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  br i1 %79, label %80, label %81

80:                                               ; preds = %63
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 4 dereferenceable(4) %9)
  br label %81

81:                                               ; preds = %80, %63
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %9, align 4, !tbaa !5
  br label %59, !llvm.loop !13

85:                                               ; preds = %62
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<20000010>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(2500008), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::bitset<20000010>::reference" = type { ptr, i64 }

@primes = external dso_local global %"class.std::vector", align 8
@is_prime = external dso_local global { [312501 x i64] }, align 8
@pi = external dso_local local_unnamed_addr global [20000010 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5sievev() local_unnamed_addr #0 {
  %1 = alloca %"class.std::bitset<20000010>::reference", align 8
  %2 = alloca %"class.std::bitset<20000010>::reference", align 8
  %3 = alloca %"class.std::bitset<20000010>::reference", align 8
  %4 = alloca %"class.std::bitset<20000010>::reference", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::bitset<20000010>::reference", align 8
  %7 = alloca %"class.std::bitset<20000010>::reference", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #3
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %1, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef 2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %1) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #3
  br label %9

9:                                                ; preds = %0, %9
  %indvars.iv = phi i64 [ 3, %0 ], [ %indvars.iv.next, %9 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #3
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %2, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %indvars.iv)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext true) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %11 = icmp ult i64 %indvars.iv, 20000008
  br i1 %11, label %9, label %.preheader, !llvm.loop !5

.preheader:                                       ; preds = %9, %._crit_edge
  %indvars.iv28 = phi i64 [ %indvars.iv.next29, %._crit_edge ], [ 3, %9 ]
  %indvars.iv23 = phi i64 [ %indvars.iv.next24, %._crit_edge ], [ 6, %9 ]
  %12 = phi i64 [ %15, %._crit_edge ], [ 9, %9 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %3, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %indvars.iv28)
  %13 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  br i1 %13, label %.lr.ph, label %._crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 2
  %15 = mul nuw nsw i64 %indvars.iv.next29, %indvars.iv.next29
  %16 = icmp ult i64 %15, 20000010
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 4
  br i1 %16, label %.preheader, label %14, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv25 = phi i64 [ %indvars.iv.next26, %.lr.ph ], [ %12, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %4, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %indvars.iv25)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %4, i1 noundef zeroext false) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, %indvars.iv23
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %3, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %indvars.iv28)
  %18 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  %19 = icmp ult i64 %indvars.iv.next26, 20000010
  %20 = select i1 %18, i1 %19, i1 false
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !12

21:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret void

22:                                               ; preds = %14, %38
  %storemerge21 = phi i32 [ 1, %14 ], [ %40, %38 ]
  %23 = add nsw i32 %storemerge21, -1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [20000010 x i32], ptr @pi, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %27 = sext i32 %storemerge21 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %6, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %27)
  %28 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  %29 = zext i1 %28 to i32
  %30 = add nsw i32 %26, %29
  %31 = load i32, ptr %5, align 4, !tbaa !7
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [20000010 x i32], ptr @pi, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !7
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %34 = load i32, ptr %5, align 4, !tbaa !7
  %35 = sext i32 %34 to i64
  call void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<20000010>::reference") align 8 %7, ptr noundef nonnull align 8 dereferenceable(2500008) @is_prime, i64 noundef %35)
  %36 = call noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  call void @_ZNSt6bitsetILm20000010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br i1 %36, label %37, label %38

37:                                               ; preds = %22
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %38

38:                                               ; preds = %22, %37
  %39 = load i32, ptr %5, align 4, !tbaa !7
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %5, align 4, !tbaa !7
  %41 = icmp slt i32 %39, 20000009
  br i1 %41, label %22, label %21, !llvm.loop !13
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm20000010EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<20000010>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(2500008), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm20000010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm20000010EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}


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