; LLVM IR from sgtlaugh/algovault :: code_library/fast_sieve.ll (Z10fast_sievev)

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

@prime_cnt = external dso_local global i32, align 4
@sp = external dso_local global [65536 x i32], align 16
@primes = external dso_local global [106000000 x i32], align 16
@wheel = external dso_local global [15015 x i64], align 16
@mask = external dso_local global [12 x [62 x [8192 x i64]]], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11small_sievev() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13process_blockj(i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z6setbitPmj(ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15populate_primesj(i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10fast_sievev() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @_Z11small_sievev()
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %32, %0
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp ule i32 %9, 5
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %35

12:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = icmp ugt i32 %14, 3
  %16 = zext i1 %15 to i32
  %17 = add i32 %13, %16
  store i32 %17, ptr %3, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %24, %12
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = icmp ult i32 %19, 960960
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %31

22:                                               ; preds = %18
  %23 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z6setbitPmj(ptr noundef @wheel, i32 noundef %23)
  br label %24

24:                                               ; preds = %22
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds [65536 x i32], ptr @sp, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = add i32 %29, %28
  store i32 %30, ptr %3, align 4, !tbaa !5
  br label %18, !llvm.loop !9

31:                                               ; preds = %21
  br label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = add i32 %33, 1
  store i32 %34, ptr %1, align 4, !tbaa !5
  br label %8, !llvm.loop !11

35:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 6, ptr %4, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %77, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = icmp ule i32 %37, 17
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %80

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %73, %40
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds [65536 x i32], ptr @sp, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp ult i32 %42, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %41
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %76

49:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %50 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %50, ptr %6, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %65, %49
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = icmp ult i32 %52, 524288
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %72

55:                                               ; preds = %51
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sub i32 %56, 6
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds [62 x [8192 x i64]], ptr %59, i64 0, i64 %61
  %63 = getelementptr inbounds [8192 x i64], ptr %62, i64 0, i64 0
  %64 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z6setbitPmj(ptr noundef %63, i32 noundef %64)
  br label %65

65:                                               ; preds = %55
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds [65536 x i32], ptr @sp, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = add i32 %70, %69
  store i32 %71, ptr %6, align 4, !tbaa !5
  br label %51, !llvm.loop !12

72:                                               ; preds = %54
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = add i32 %74, 1
  store i32 %75, ptr %5, align 4, !tbaa !5
  br label %41, !llvm.loop !13

76:                                               ; preds = %48
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = add i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !5
  br label %36, !llvm.loop !14

80:                                               ; preds = %39
  %81 = load i32, ptr @prime_cnt, align 4, !tbaa !5
  %82 = add i32 %81, 1
  store i32 %82, ptr @prime_cnt, align 4, !tbaa !5
  %83 = zext i32 %81 to i64
  %84 = getelementptr inbounds [106000000 x i32], ptr @primes, i64 0, i64 %83
  store i32 2, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %92, %80
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = icmp ule i32 %86, 2147483647
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 17, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %95

89:                                               ; preds = %85
  %90 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z13process_blockj(i32 noundef %90)
  %91 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z15populate_primesj(i32 noundef %91)
  br label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = add i32 %93, 1048576
  store i32 %94, ptr %7, align 4, !tbaa !5
  br label %85, !llvm.loop !15

95:                                               ; preds = %88
  ret void
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

@prime_cnt = external dso_local local_unnamed_addr global i32, align 4
@sp = external dso_local local_unnamed_addr global [65536 x i32], align 16
@primes = external dso_local local_unnamed_addr global [106000000 x i32], align 16
@wheel = external dso_local global [15015 x i64], align 16
@mask = external dso_local global [12 x [62 x [8192 x i64]]], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11small_sievev() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z13process_blockj(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z6setbitPmj(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15populate_primesj(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10fast_sievev() local_unnamed_addr #1 {
.lr.ph:
  tail call void @_Z11small_sievev()
  br label %13

.lr.ph.1:                                         ; preds = %13, %.lr.ph.1
  %.02731.1 = phi i32 [ %1, %.lr.ph.1 ], [ 2, %13 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull @wheel, i32 noundef %.02731.1)
  %0 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 8), align 8, !tbaa !5
  %1 = add i32 %0, %.02731.1
  %2 = icmp ult i32 %1, 960960
  br i1 %2, label %.lr.ph.1, label %.lr.ph.2, !llvm.loop !9

.lr.ph.2:                                         ; preds = %.lr.ph.1, %.lr.ph.2
  %.02731.2 = phi i32 [ %4, %.lr.ph.2 ], [ 3, %.lr.ph.1 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull @wheel, i32 noundef %.02731.2)
  %3 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 12), align 4, !tbaa !5
  %4 = add i32 %3, %.02731.2
  %5 = icmp ult i32 %4, 960960
  br i1 %5, label %.lr.ph.2, label %.lr.ph.3, !llvm.loop !9

.lr.ph.3:                                         ; preds = %.lr.ph.2, %.lr.ph.3
  %.02731.3 = phi i32 [ %7, %.lr.ph.3 ], [ 5, %.lr.ph.2 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull @wheel, i32 noundef %.02731.3)
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 16), align 16, !tbaa !5
  %7 = add i32 %6, %.02731.3
  %8 = icmp ult i32 %7, 960960
  br i1 %8, label %.lr.ph.3, label %.lr.ph.4, !llvm.loop !9

.lr.ph.4:                                         ; preds = %.lr.ph.3, %.lr.ph.4
  %.02731.4 = phi i32 [ %10, %.lr.ph.4 ], [ 6, %.lr.ph.3 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull @wheel, i32 noundef %.02731.4)
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 20), align 4, !tbaa !5
  %10 = add i32 %9, %.02731.4
  %11 = icmp ult i32 %10, 960960
  br i1 %11, label %.lr.ph.4, label %._crit_edge.4, !llvm.loop !9

._crit_edge.4:                                    ; preds = %.lr.ph.4
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 24), align 8, !tbaa !5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %._crit_edge37, label %.preheader

13:                                               ; preds = %.lr.ph, %13
  %.02731 = phi i32 [ 1, %.lr.ph ], [ %15, %13 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull @wheel, i32 noundef %.02731)
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 4), align 4, !tbaa !5
  %15 = add i32 %14, %.02731
  %16 = icmp ult i32 %15, 960960
  br i1 %16, label %13, label %.lr.ph.1, !llvm.loop !9

.preheader:                                       ; preds = %._crit_edge.4, %._crit_edge35
  %17 = phi i32 [ %157, %._crit_edge35 ], [ %12, %._crit_edge.4 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge35 ], [ 0, %._crit_edge.4 ]
  %18 = icmp ult i64 %indvars.iv, 524288
  br i1 %18, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %.preheader
  %19 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 0, i64 %indvars.iv
  %20 = trunc nuw i64 %indvars.iv to i32
  br label %160

._crit_edge37:                                    ; preds = %._crit_edge35, %._crit_edge.4
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 28), align 4, !tbaa !5
  %.not.1 = icmp eq i32 %21, 0
  br i1 %.not.1, label %._crit_edge37.1, label %.preheader.1

.preheader.1:                                     ; preds = %._crit_edge37, %._crit_edge35.1
  %22 = phi i32 [ %30, %._crit_edge35.1 ], [ %21, %._crit_edge37 ]
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %._crit_edge35.1 ], [ 0, %._crit_edge37 ]
  %23 = icmp ult i64 %indvars.iv.1, 524288
  br i1 %23, label %.lr.ph34.1, label %._crit_edge35.1

.lr.ph34.1:                                       ; preds = %.preheader.1
  %24 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 1, i64 %indvars.iv.1
  %25 = trunc nuw i64 %indvars.iv.1 to i32
  br label %26

26:                                               ; preds = %26, %.lr.ph34.1
  %.02433.1 = phi i32 [ %25, %.lr.ph34.1 ], [ %28, %26 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %24, i32 noundef %.02433.1)
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 28), align 4, !tbaa !5
  %28 = add i32 %27, %.02433.1
  %29 = icmp ult i32 %28, 524288
  br i1 %29, label %26, label %._crit_edge35.1, !llvm.loop !11

._crit_edge35.1:                                  ; preds = %26, %.preheader.1
  %30 = phi i32 [ %22, %.preheader.1 ], [ %27, %26 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %31 = zext i32 %30 to i64
  %32 = icmp ult i64 %indvars.iv.next.1, %31
  br i1 %32, label %.preheader.1, label %._crit_edge37.1, !llvm.loop !12

._crit_edge37.1:                                  ; preds = %._crit_edge35.1, %._crit_edge37
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 32), align 16, !tbaa !5
  %.not.2 = icmp eq i32 %33, 0
  br i1 %.not.2, label %._crit_edge37.2, label %.preheader.2

.preheader.2:                                     ; preds = %._crit_edge37.1, %._crit_edge35.2
  %34 = phi i32 [ %42, %._crit_edge35.2 ], [ %33, %._crit_edge37.1 ]
  %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %._crit_edge35.2 ], [ 0, %._crit_edge37.1 ]
  %35 = icmp ult i64 %indvars.iv.2, 524288
  br i1 %35, label %.lr.ph34.2, label %._crit_edge35.2

.lr.ph34.2:                                       ; preds = %.preheader.2
  %36 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 2, i64 %indvars.iv.2
  %37 = trunc nuw i64 %indvars.iv.2 to i32
  br label %38

38:                                               ; preds = %38, %.lr.ph34.2
  %.02433.2 = phi i32 [ %37, %.lr.ph34.2 ], [ %40, %38 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %36, i32 noundef %.02433.2)
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 32), align 16, !tbaa !5
  %40 = add i32 %39, %.02433.2
  %41 = icmp ult i32 %40, 524288
  br i1 %41, label %38, label %._crit_edge35.2, !llvm.loop !11

._crit_edge35.2:                                  ; preds = %38, %.preheader.2
  %42 = phi i32 [ %34, %.preheader.2 ], [ %39, %38 ]
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %43 = zext i32 %42 to i64
  %44 = icmp ult i64 %indvars.iv.next.2, %43
  br i1 %44, label %.preheader.2, label %._crit_edge37.2, !llvm.loop !12

._crit_edge37.2:                                  ; preds = %._crit_edge35.2, %._crit_edge37.1
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 36), align 4, !tbaa !5
  %.not.3 = icmp eq i32 %45, 0
  br i1 %.not.3, label %._crit_edge37.3, label %.preheader.3

.preheader.3:                                     ; preds = %._crit_edge37.2, %._crit_edge35.3
  %46 = phi i32 [ %54, %._crit_edge35.3 ], [ %45, %._crit_edge37.2 ]
  %indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %._crit_edge35.3 ], [ 0, %._crit_edge37.2 ]
  %47 = icmp ult i64 %indvars.iv.3, 524288
  br i1 %47, label %.lr.ph34.3, label %._crit_edge35.3

.lr.ph34.3:                                       ; preds = %.preheader.3
  %48 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 3, i64 %indvars.iv.3
  %49 = trunc nuw i64 %indvars.iv.3 to i32
  br label %50

50:                                               ; preds = %50, %.lr.ph34.3
  %.02433.3 = phi i32 [ %49, %.lr.ph34.3 ], [ %52, %50 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %48, i32 noundef %.02433.3)
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 36), align 4, !tbaa !5
  %52 = add i32 %51, %.02433.3
  %53 = icmp ult i32 %52, 524288
  br i1 %53, label %50, label %._crit_edge35.3, !llvm.loop !11

._crit_edge35.3:                                  ; preds = %50, %.preheader.3
  %54 = phi i32 [ %46, %.preheader.3 ], [ %51, %50 ]
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %55 = zext i32 %54 to i64
  %56 = icmp ult i64 %indvars.iv.next.3, %55
  br i1 %56, label %.preheader.3, label %._crit_edge37.3, !llvm.loop !12

._crit_edge37.3:                                  ; preds = %._crit_edge35.3, %._crit_edge37.2
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 40), align 8, !tbaa !5
  %.not.4 = icmp eq i32 %57, 0
  br i1 %.not.4, label %._crit_edge37.4, label %.preheader.4

.preheader.4:                                     ; preds = %._crit_edge37.3, %._crit_edge35.4
  %58 = phi i32 [ %66, %._crit_edge35.4 ], [ %57, %._crit_edge37.3 ]
  %indvars.iv.4 = phi i64 [ %indvars.iv.next.4, %._crit_edge35.4 ], [ 0, %._crit_edge37.3 ]
  %59 = icmp ult i64 %indvars.iv.4, 524288
  br i1 %59, label %.lr.ph34.4, label %._crit_edge35.4

.lr.ph34.4:                                       ; preds = %.preheader.4
  %60 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 4, i64 %indvars.iv.4
  %61 = trunc nuw i64 %indvars.iv.4 to i32
  br label %62

62:                                               ; preds = %62, %.lr.ph34.4
  %.02433.4 = phi i32 [ %61, %.lr.ph34.4 ], [ %64, %62 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %60, i32 noundef %.02433.4)
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 40), align 8, !tbaa !5
  %64 = add i32 %63, %.02433.4
  %65 = icmp ult i32 %64, 524288
  br i1 %65, label %62, label %._crit_edge35.4, !llvm.loop !11

._crit_edge35.4:                                  ; preds = %62, %.preheader.4
  %66 = phi i32 [ %58, %.preheader.4 ], [ %63, %62 ]
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %67 = zext i32 %66 to i64
  %68 = icmp ult i64 %indvars.iv.next.4, %67
  br i1 %68, label %.preheader.4, label %._crit_edge37.4, !llvm.loop !12

._crit_edge37.4:                                  ; preds = %._crit_edge35.4, %._crit_edge37.3
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 44), align 4, !tbaa !5
  %.not.5 = icmp eq i32 %69, 0
  br i1 %.not.5, label %._crit_edge37.5, label %.preheader.5

.preheader.5:                                     ; preds = %._crit_edge37.4, %._crit_edge35.5
  %70 = phi i32 [ %78, %._crit_edge35.5 ], [ %69, %._crit_edge37.4 ]
  %indvars.iv.5 = phi i64 [ %indvars.iv.next.5, %._crit_edge35.5 ], [ 0, %._crit_edge37.4 ]
  %71 = icmp ult i64 %indvars.iv.5, 524288
  br i1 %71, label %.lr.ph34.5, label %._crit_edge35.5

.lr.ph34.5:                                       ; preds = %.preheader.5
  %72 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 5, i64 %indvars.iv.5
  %73 = trunc nuw i64 %indvars.iv.5 to i32
  br label %74

74:                                               ; preds = %74, %.lr.ph34.5
  %.02433.5 = phi i32 [ %73, %.lr.ph34.5 ], [ %76, %74 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %72, i32 noundef %.02433.5)
  %75 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 44), align 4, !tbaa !5
  %76 = add i32 %75, %.02433.5
  %77 = icmp ult i32 %76, 524288
  br i1 %77, label %74, label %._crit_edge35.5, !llvm.loop !11

._crit_edge35.5:                                  ; preds = %74, %.preheader.5
  %78 = phi i32 [ %70, %.preheader.5 ], [ %75, %74 ]
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %79 = zext i32 %78 to i64
  %80 = icmp ult i64 %indvars.iv.next.5, %79
  br i1 %80, label %.preheader.5, label %._crit_edge37.5, !llvm.loop !12

._crit_edge37.5:                                  ; preds = %._crit_edge35.5, %._crit_edge37.4
  %81 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 48), align 16, !tbaa !5
  %.not.6 = icmp eq i32 %81, 0
  br i1 %.not.6, label %._crit_edge37.6, label %.preheader.6

.preheader.6:                                     ; preds = %._crit_edge37.5, %._crit_edge35.6
  %82 = phi i32 [ %90, %._crit_edge35.6 ], [ %81, %._crit_edge37.5 ]
  %indvars.iv.6 = phi i64 [ %indvars.iv.next.6, %._crit_edge35.6 ], [ 0, %._crit_edge37.5 ]
  %83 = icmp ult i64 %indvars.iv.6, 524288
  br i1 %83, label %.lr.ph34.6, label %._crit_edge35.6

.lr.ph34.6:                                       ; preds = %.preheader.6
  %84 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 6, i64 %indvars.iv.6
  %85 = trunc nuw i64 %indvars.iv.6 to i32
  br label %86

86:                                               ; preds = %86, %.lr.ph34.6
  %.02433.6 = phi i32 [ %85, %.lr.ph34.6 ], [ %88, %86 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %84, i32 noundef %.02433.6)
  %87 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 48), align 16, !tbaa !5
  %88 = add i32 %87, %.02433.6
  %89 = icmp ult i32 %88, 524288
  br i1 %89, label %86, label %._crit_edge35.6, !llvm.loop !11

._crit_edge35.6:                                  ; preds = %86, %.preheader.6
  %90 = phi i32 [ %82, %.preheader.6 ], [ %87, %86 ]
  %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
  %91 = zext i32 %90 to i64
  %92 = icmp ult i64 %indvars.iv.next.6, %91
  br i1 %92, label %.preheader.6, label %._crit_edge37.6, !llvm.loop !12

._crit_edge37.6:                                  ; preds = %._crit_edge35.6, %._crit_edge37.5
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 52), align 4, !tbaa !5
  %.not.7 = icmp eq i32 %93, 0
  br i1 %.not.7, label %._crit_edge37.7, label %.preheader.7

.preheader.7:                                     ; preds = %._crit_edge37.6, %._crit_edge35.7
  %94 = phi i32 [ %102, %._crit_edge35.7 ], [ %93, %._crit_edge37.6 ]
  %indvars.iv.7 = phi i64 [ %indvars.iv.next.7, %._crit_edge35.7 ], [ 0, %._crit_edge37.6 ]
  %95 = icmp ult i64 %indvars.iv.7, 524288
  br i1 %95, label %.lr.ph34.7, label %._crit_edge35.7

.lr.ph34.7:                                       ; preds = %.preheader.7
  %96 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 7, i64 %indvars.iv.7
  %97 = trunc nuw i64 %indvars.iv.7 to i32
  br label %98

98:                                               ; preds = %98, %.lr.ph34.7
  %.02433.7 = phi i32 [ %97, %.lr.ph34.7 ], [ %100, %98 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %96, i32 noundef %.02433.7)
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 52), align 4, !tbaa !5
  %100 = add i32 %99, %.02433.7
  %101 = icmp ult i32 %100, 524288
  br i1 %101, label %98, label %._crit_edge35.7, !llvm.loop !11

._crit_edge35.7:                                  ; preds = %98, %.preheader.7
  %102 = phi i32 [ %94, %.preheader.7 ], [ %99, %98 ]
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
  %103 = zext i32 %102 to i64
  %104 = icmp ult i64 %indvars.iv.next.7, %103
  br i1 %104, label %.preheader.7, label %._crit_edge37.7, !llvm.loop !12

._crit_edge37.7:                                  ; preds = %._crit_edge35.7, %._crit_edge37.6
  %105 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 56), align 8, !tbaa !5
  %.not.8 = icmp eq i32 %105, 0
  br i1 %.not.8, label %._crit_edge37.8, label %.preheader.8

.preheader.8:                                     ; preds = %._crit_edge37.7, %._crit_edge35.8
  %106 = phi i32 [ %114, %._crit_edge35.8 ], [ %105, %._crit_edge37.7 ]
  %indvars.iv.8 = phi i64 [ %indvars.iv.next.8, %._crit_edge35.8 ], [ 0, %._crit_edge37.7 ]
  %107 = icmp ult i64 %indvars.iv.8, 524288
  br i1 %107, label %.lr.ph34.8, label %._crit_edge35.8

.lr.ph34.8:                                       ; preds = %.preheader.8
  %108 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 8, i64 %indvars.iv.8
  %109 = trunc nuw i64 %indvars.iv.8 to i32
  br label %110

110:                                              ; preds = %110, %.lr.ph34.8
  %.02433.8 = phi i32 [ %109, %.lr.ph34.8 ], [ %112, %110 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %108, i32 noundef %.02433.8)
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 56), align 8, !tbaa !5
  %112 = add i32 %111, %.02433.8
  %113 = icmp ult i32 %112, 524288
  br i1 %113, label %110, label %._crit_edge35.8, !llvm.loop !11

._crit_edge35.8:                                  ; preds = %110, %.preheader.8
  %114 = phi i32 [ %106, %.preheader.8 ], [ %111, %110 ]
  %indvars.iv.next.8 = add nuw nsw i64 %indvars.iv.8, 1
  %115 = zext i32 %114 to i64
  %116 = icmp ult i64 %indvars.iv.next.8, %115
  br i1 %116, label %.preheader.8, label %._crit_edge37.8, !llvm.loop !12

._crit_edge37.8:                                  ; preds = %._crit_edge35.8, %._crit_edge37.7
  %117 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 60), align 4, !tbaa !5
  %.not.9 = icmp eq i32 %117, 0
  br i1 %.not.9, label %._crit_edge37.9, label %.preheader.9

.preheader.9:                                     ; preds = %._crit_edge37.8, %._crit_edge35.9
  %118 = phi i32 [ %126, %._crit_edge35.9 ], [ %117, %._crit_edge37.8 ]
  %indvars.iv.9 = phi i64 [ %indvars.iv.next.9, %._crit_edge35.9 ], [ 0, %._crit_edge37.8 ]
  %119 = icmp ult i64 %indvars.iv.9, 524288
  br i1 %119, label %.lr.ph34.9, label %._crit_edge35.9

.lr.ph34.9:                                       ; preds = %.preheader.9
  %120 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 9, i64 %indvars.iv.9
  %121 = trunc nuw i64 %indvars.iv.9 to i32
  br label %122

122:                                              ; preds = %122, %.lr.ph34.9
  %.02433.9 = phi i32 [ %121, %.lr.ph34.9 ], [ %124, %122 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %120, i32 noundef %.02433.9)
  %123 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 60), align 4, !tbaa !5
  %124 = add i32 %123, %.02433.9
  %125 = icmp ult i32 %124, 524288
  br i1 %125, label %122, label %._crit_edge35.9, !llvm.loop !11

._crit_edge35.9:                                  ; preds = %122, %.preheader.9
  %126 = phi i32 [ %118, %.preheader.9 ], [ %123, %122 ]
  %indvars.iv.next.9 = add nuw nsw i64 %indvars.iv.9, 1
  %127 = zext i32 %126 to i64
  %128 = icmp ult i64 %indvars.iv.next.9, %127
  br i1 %128, label %.preheader.9, label %._crit_edge37.9, !llvm.loop !12

._crit_edge37.9:                                  ; preds = %._crit_edge35.9, %._crit_edge37.8
  %129 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 64), align 16, !tbaa !5
  %.not.10 = icmp eq i32 %129, 0
  br i1 %.not.10, label %._crit_edge37.10, label %.preheader.10

.preheader.10:                                    ; preds = %._crit_edge37.9, %._crit_edge35.10
  %130 = phi i32 [ %138, %._crit_edge35.10 ], [ %129, %._crit_edge37.9 ]
  %indvars.iv.10 = phi i64 [ %indvars.iv.next.10, %._crit_edge35.10 ], [ 0, %._crit_edge37.9 ]
  %131 = icmp ult i64 %indvars.iv.10, 524288
  br i1 %131, label %.lr.ph34.10, label %._crit_edge35.10

.lr.ph34.10:                                      ; preds = %.preheader.10
  %132 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 10, i64 %indvars.iv.10
  %133 = trunc nuw i64 %indvars.iv.10 to i32
  br label %134

134:                                              ; preds = %134, %.lr.ph34.10
  %.02433.10 = phi i32 [ %133, %.lr.ph34.10 ], [ %136, %134 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %132, i32 noundef %.02433.10)
  %135 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 64), align 16, !tbaa !5
  %136 = add i32 %135, %.02433.10
  %137 = icmp ult i32 %136, 524288
  br i1 %137, label %134, label %._crit_edge35.10, !llvm.loop !11

._crit_edge35.10:                                 ; preds = %134, %.preheader.10
  %138 = phi i32 [ %130, %.preheader.10 ], [ %135, %134 ]
  %indvars.iv.next.10 = add nuw nsw i64 %indvars.iv.10, 1
  %139 = zext i32 %138 to i64
  %140 = icmp ult i64 %indvars.iv.next.10, %139
  br i1 %140, label %.preheader.10, label %._crit_edge37.10, !llvm.loop !12

._crit_edge37.10:                                 ; preds = %._crit_edge35.10, %._crit_edge37.9
  %141 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 68), align 4, !tbaa !5
  %.not.11 = icmp eq i32 %141, 0
  br i1 %.not.11, label %._crit_edge37.11, label %.preheader.11

.preheader.11:                                    ; preds = %._crit_edge37.10, %._crit_edge35.11
  %142 = phi i32 [ %150, %._crit_edge35.11 ], [ %141, %._crit_edge37.10 ]
  %indvars.iv.11 = phi i64 [ %indvars.iv.next.11, %._crit_edge35.11 ], [ 0, %._crit_edge37.10 ]
  %143 = icmp ult i64 %indvars.iv.11, 524288
  br i1 %143, label %.lr.ph34.11, label %._crit_edge35.11

.lr.ph34.11:                                      ; preds = %.preheader.11
  %144 = getelementptr inbounds [12 x [62 x [8192 x i64]]], ptr @mask, i64 0, i64 11, i64 %indvars.iv.11
  %145 = trunc nuw i64 %indvars.iv.11 to i32
  br label %146

146:                                              ; preds = %146, %.lr.ph34.11
  %.02433.11 = phi i32 [ %145, %.lr.ph34.11 ], [ %148, %146 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %144, i32 noundef %.02433.11)
  %147 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 68), align 4, !tbaa !5
  %148 = add i32 %147, %.02433.11
  %149 = icmp ult i32 %148, 524288
  br i1 %149, label %146, label %._crit_edge35.11, !llvm.loop !11

._crit_edge35.11:                                 ; preds = %146, %.preheader.11
  %150 = phi i32 [ %142, %.preheader.11 ], [ %147, %146 ]
  %indvars.iv.next.11 = add nuw nsw i64 %indvars.iv.11, 1
  %151 = zext i32 %150 to i64
  %152 = icmp ult i64 %indvars.iv.next.11, %151
  br i1 %152, label %.preheader.11, label %._crit_edge37.11, !llvm.loop !12

._crit_edge37.11:                                 ; preds = %._crit_edge35.11, %._crit_edge37.10
  %153 = load i32, ptr @prime_cnt, align 4, !tbaa !5
  %154 = add i32 %153, 1
  store i32 %154, ptr @prime_cnt, align 4, !tbaa !5
  %155 = zext i32 %153 to i64
  %156 = getelementptr inbounds [106000000 x i32], ptr @primes, i64 0, i64 %155
  store i32 2, ptr %156, align 4, !tbaa !5
  br label %165

._crit_edge35:                                    ; preds = %160, %.preheader
  %157 = phi i32 [ %17, %.preheader ], [ %161, %160 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %158 = zext i32 %157 to i64
  %159 = icmp ult i64 %indvars.iv.next, %158
  br i1 %159, label %.preheader, label %._crit_edge37, !llvm.loop !12

160:                                              ; preds = %.lr.ph34, %160
  %.02433 = phi i32 [ %20, %.lr.ph34 ], [ %162, %160 ]
  tail call void @_Z6setbitPmj(ptr noundef nonnull %19, i32 noundef %.02433)
  %161 = load i32, ptr getelementptr inbounds (i8, ptr @sp, i64 24), align 8, !tbaa !5
  %162 = add i32 %161, %.02433
  %163 = icmp ult i32 %162, 524288
  br i1 %163, label %160, label %._crit_edge35, !llvm.loop !11

164:                                              ; preds = %165
  ret void

165:                                              ; preds = %._crit_edge37.11, %165
  %.039 = phi i32 [ 0, %._crit_edge37.11 ], [ %166, %165 ]
  tail call void @_Z13process_blockj(i32 noundef %.039)
  tail call void @_Z15populate_primesj(i32 noundef %.039)
  %166 = add nuw i32 %.039, 1048576
  %167 = icmp sgt i32 %166, -1
  br i1 %167, label %165, label %164, !llvm.loop !13
}

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 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 = { 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" }

!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}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass